Global environment variable is disappearing after logout
Posted: Wed Jan 01, 2020 11:15 pm
Hello,
I've created a simple script which is storing a value inside a global environment variable. It should be part of a bigger script but for simplification i reduced it to the essential.
When I run the script, I can see that the variable is set properly.
When I log back in after some time, the variable does not appear anymore, neither on console nor in the webinterface. The table is empty now. When I stay logged in, the variable doesn't seem to disappear. But sometimes I see that the variable still exists after logging out and logging back in.
Aren't the global variables persistent? If not, what is the best practice to store values for later usage in a periodic run script
I've created a simple script which is storing a value inside a global environment variable. It should be part of a bigger script but for simplification i reduced it to the essential.
Code: Select all
> /system script print
Flags: I - invalid
0 name="testscript" owner="admin" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon dont-require-permissions=no
last-started=jan/01/2020 22:01:58 run-count=1 source=
:global oldprefix;
:local curprefix;
:set curprefix [/ipv6 pool get telekom-pd prefix]
:set oldprefix $curprefix
Code: Select all
> /system script run 0
> /system script environment print
# NAME VALUE
0 oldprefix 2003:de:ffff:ff00::/56
Code: Select all
> /system script environment print
# NAME VALUE