Symantec logo

Example: Using script entry points on Windows

The following example shows how to build the FileOnOff agent without writing and compiling any C++ code. This example implements the online, offline, and monitor entry points only.

 Example: implementing entry points without C++

  1. Create the directory %VCS_HOME%\bin\FileOnOff:

C:\> md %VCS_HOME%\bin\FileOnOff

  1. Use %VCS_HOME%\bin\VCSdefault.dll as the agent DLL.

    Copy the file to %VCS_HOME%\bin\FileOnOff.dll, as shown below:

C:\> copy %VCS_HOME%\bin\VCSdefault.dll

%VCS_HOME%\bin\FileOnOff\FileOnOff.dll

  1. Implement the online, offline, and monitor entry points using scripts. The examples below use shell scripts. MKS Toolkit or equivalent software is required for running shell scripts. Entry points can also be implemented as batch files.
    1. Using any editor, create the file%VCS_HOME%\FileOnOff\online.sh with the following contents:

# Create the file specified by the PathName

# attribute.

touch $2

    1. Create the file %VCS_HOME%\bin\FileOnOff\offline.sh with the following contents:

# Remove the file specified by the PathName

# attribute.

rm $2

    1. Create the file %VCS_HOME%\bin\FileOnOff\monitor.sh with the following contents:

# Verify that file specified by PathName

# attribute exists.

if test -f $2

then exit 110;

else exit 100;

fi

Additionally, you can implement the info and action entry points. For the action entry point, create a subdirectory named "actions" under the agent directory, and create scripts with the same names as the action_tokens within the subdirectory.