You want to run shell commands before a specific session is started or after it has terminated.
You need hooks which will call your shell commands.
As of IGEL Universal Desktop Linux 5.06.100 there is a generic mechanism for calling shell commands before and after a session. It works with Citrix ICA, RDP and VNC Viewer sessions.
This feature is accessible only through the Registry.
Open Setup at System > Registry. Use either the Registry tree or the Search parameter ... function to locate the following Registry keys:
(where * is the related session number, e.g. 0,1,2,3,...)
init_action is executed before the session is started. The
final_action is executed after the session has been terminated. Enter shell commands or the path to a custom script or executable:
init_actionscripts or executables have to return before the session will start. Alternatively, background your command by adding
'&'to the end of the commandline.