mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-29 07:14:45 +02:00
global: use $0 for $ScriptFromTerminal
This commit is contained in:
parent
041ca062b1
commit
766a92a74b
2 changed files with 4 additions and 4 deletions
|
@ -93,7 +93,7 @@ $WaitFullyConnected;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ $ScriptFromTerminal "check-routeros-update" ] = true) do={
|
:if ([ $ScriptFromTerminal $0 ] = true) do={
|
||||||
:put ("Do you want to install RouterOS version " . $Update->"latest-version" . "? [y/N]");
|
:put ("Do you want to install RouterOS version " . $Update->"latest-version" . "? [y/N]");
|
||||||
:if (([ :terminal inkey timeout=60 ] % 32) = 25) do={
|
:if (([ :terminal inkey timeout=60 ] % 32) = 25) do={
|
||||||
$DoUpdate;
|
$DoUpdate;
|
||||||
|
|
|
@ -33,7 +33,7 @@ $ScriptLock $0;
|
||||||
|
|
||||||
:local DoDowngrade false;
|
:local DoDowngrade false;
|
||||||
:if ($NumInstalled > $NumLatest) do={
|
:if ($NumInstalled > $NumLatest) do={
|
||||||
:if ([ $ScriptFromTerminal "packages-update" ] = true) do={
|
:if ([ $ScriptFromTerminal $0 ] = true) do={
|
||||||
:put "Latest version is older than installed one. Want to downgrade? [y/N]";
|
:put "Latest version is older than installed one. Want to downgrade? [y/N]";
|
||||||
:if (([ :terminal inkey timeout=60 ] % 32) = 25) do={
|
:if (([ :terminal inkey timeout=60 ] % 32) = 25) do={
|
||||||
:set DoDowngrade true;
|
:set DoDowngrade true;
|
||||||
|
@ -59,7 +59,7 @@ $ScriptLock $0;
|
||||||
/ system script run $Script;
|
/ system script run $Script;
|
||||||
} on-error={
|
} on-error={
|
||||||
$LogPrintExit2 warning $0 ("Running backup script " . $ScriptName . " before update failed!") false;
|
$LogPrintExit2 warning $0 ("Running backup script " . $ScriptName . " before update failed!") false;
|
||||||
:if ([ $ScriptFromTerminal "packages-update" ] = true) do={
|
:if ([ $ScriptFromTerminal $0 ] = true) do={
|
||||||
:put "Do you want to continue anyway? [y/N]";
|
:put "Do you want to continue anyway? [y/N]";
|
||||||
:if (([ :terminal inkey timeout=60 ] % 32) = 25) do={
|
:if (([ :terminal inkey timeout=60 ] % 32) = 25) do={
|
||||||
$LogPrintExit2 info $0 ("User requested to continue anyway.") false;
|
$LogPrintExit2 info $0 ("User requested to continue anyway.") false;
|
||||||
|
@ -78,7 +78,7 @@ $ScriptLock $0;
|
||||||
/ system package downgrade;
|
/ system package downgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ $ScriptFromTerminal "packages-update" ] = true) do={
|
:if ([ $ScriptFromTerminal $0 ] = true) do={
|
||||||
:put "Do you want to (s)chedule reboot or (r)eboot now? [s/R]";
|
:put "Do you want to (s)chedule reboot or (r)eboot now? [s/R]";
|
||||||
:if (([ :terminal inkey timeout=60 ] % 32) = 19) do={
|
:if (([ :terminal inkey timeout=60 ] % 32) = 19) do={
|
||||||
/ system scheduler add name="reboot-for-update" start-time=03:00:00 interval=1d \
|
/ system scheduler add name="reboot-for-update" start-time=03:00:00 interval=1d \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue