1.0

Table Of Contents
CHAPTER 14 Understanding Policies
253
StdOut.Write DateDiff("s", "1/1/1970", "1/1/2010")
End If
Sample Device Connection Script
The following sample script is written in C. It is installed by VMware ACE Manager as
sampleDevice.c. You may compile it with a C compiler if you want to run it.
/*
* VMware Sample Script
*
* This is a sample device policy script for VMware ACE.
* Notes about this sample:
*
* This script will examine the contents of an environment variable
* and output YES if the variable is set, or NO if it isn't.
*
* This script always exits successfully (exit code 0)
*
* The environment variable is called TEST_DEVICE
*
* Input to script:
* This script does not depend on any environment variables set by
* VMware ACE
*
* Returns:
* Returns 0 for success
*
* Expected output:
* The script may output to stdout:
* 'YES' - Allow the user to manage the device
* 'NO' - Do not allow the user to manage the device
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int
main(int argc,
char *argv[])
{
char *env_var;
/* Test for existence of TEST_DEVICE variable in environment: */