Admin-levels scripting notes:
* On Windows, scripts that run with admin privileges may not
be able to interact with the desktop.
* Admin-level scripts (if allowed) will be executed by the client
even if the end-user who is currently operating the client
does not possess admin privileges.
Special environmental variables that may be set on the AS:
PREPATH — if defined, will be prepended to client’s PATH before the
script is executed.
Special environmental variables set by the client backend before
scripts are executed:
N_RECONNECTS (integer rendered as string) — the number of reconnects
that have occurred thus far in this session.
GRACEFUL_DISCONNECT (“0" or “1") — set to “1" if this disconnect was
requested by the user, and “0" if the disconnect
Script shebang usage for Windows (on unix, shebangs are processed by the OS):
The “shebang" is a unix construct for designating the interpreter that
should process a script, by including a specially coded line beginning
with “#!" as the first line of the script. When the Access Server
client runs on unix, the OS will handle the shebang usage. However
since Windows doesn’t natively recognize shebang usage, the Access
Server client will interpret the shebang line and use it to determine
how to execute the script, using the following rules:
[script content] — defaults to cmd.exe processing
[script content… — find foo.exe in path]
#!foo.exe -a somearg
[script content… — pass options (the last option is the implicit script filename)]
#!"c:\Program Files\Foo Corp\foo.exe" -a somearg
[script content… — quote the program exe]
[script content… — script will be written to a .foo file before execution]
[python code — execute python script using OpenVPN Client built-in python interpreter]
[python code — execute python script using OpenVPN Client built-in python interpreter
on Windows, and using default python install on unix.]