When I execute script manually, it sets global variable and it is visible in environment.
When script is executed via dhcp-client and admin is logged in, global variable is set and it is visible in environment.
When no-one is logged in and dhcp-client executes script, global variable is not set and also previously set (by manual or admin-logged in run) global variable disappears?
Catch is, that script checks global variable before performing action to determine, if perform it or not.
Currently it runs all the time when dhcp-server renews lease.
DHCP, ppp, netwatch etc, do not have enough permissions to get access to global variables. If you want to full permisions, ten create a script with option do-not-require-permissions and execute the script on dhcp event.
âdont-require-permissions: Bypass permissions check when script is being executed, useful when scripts are being executed from services that have limited permissions, such as Netwatchâ
For you that know the answer its easy to see that this is related.
How should someone without your knowledge know that reason that global variable does not work is due to permission?
The environment variables also have a field âuserâ but it appears not in use.
It would be nice when every script context at least had access to some global variables limited by the âuserâ field. E.g. ânetwatchâ.
(and of course a user with higher privileges preferably would have some means to read and write other userâs variables)