mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-03-04 13:09:37 +00:00
Compare commits
21 commits
4b9bfac281
...
57d9130b98
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57d9130b98 | ||
|
|
2c3042aec7 | ||
|
|
4f4c5c4424 | ||
|
|
f27d930739 | ||
|
|
a7cd84e1fd | ||
|
|
039d881899 | ||
|
|
32e3a66604 | ||
|
|
1d6165e2e7 | ||
|
|
83f9acc85c | ||
|
|
8dda10b2fd | ||
|
|
85d07cabf5 | ||
|
|
d186047e3d | ||
|
|
041d44226d | ||
|
|
09969d4040 | ||
|
|
dada0b6ec3 | ||
|
|
9c050bf678 | ||
|
|
dfe37620ab | ||
|
|
bd49191490 | ||
|
|
0574e752dc | ||
|
|
4b0f962b9d | ||
|
|
b70e6e7984 |
13 changed files with 127 additions and 75 deletions
|
|
@ -35,6 +35,7 @@ Add yourself to the list,
|
|||
[donate with PayPal ↗️](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)!
|
||||
|
||||
* Abdul Mannan Abbasi
|
||||
* Alex Maier
|
||||
* Andrea Ruffini Perico
|
||||
* Andrew Cox
|
||||
* Christoph Boss (@Kampfwurst)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
:global CleanName;
|
||||
:global DeviceInfo;
|
||||
:global FileExists;
|
||||
:global FormatLine;
|
||||
:global LogPrint;
|
||||
:global MkDir;
|
||||
|
|
@ -124,17 +125,19 @@
|
|||
attach=$Attach; remove-attach=true });
|
||||
|
||||
# wait for the mail to be sent
|
||||
:local I 0;
|
||||
:while ([ :len [ /file/find where name ~ ($FilePath . "\\.(backup|rsc)\$") ] ] > 0) do={
|
||||
:if ($I >= 120) do={
|
||||
$LogPrint warning $ScriptName ("Files are still available, sending e-mail failed.");
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
:delay 1s;
|
||||
:set I ($I + 1);
|
||||
:do {
|
||||
:retry {
|
||||
:if ([ $FileExists ($FilePath . ".conf") ".conf file" ] = true || \
|
||||
[ $FileExists ($FilePath . ".backup") "backup" ] = true || \
|
||||
[ $FileExists ($FilePath . ".rsc") "script" ] = true) do={
|
||||
:error "Files are still available.";
|
||||
}
|
||||
} delay=1s max=120;
|
||||
} on-error={
|
||||
$LogPrint warning $ScriptName ("Files are still available, sending e-mail failed.");
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
}
|
||||
# do not remove the files here, as the mail is still queued!
|
||||
} do={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.15
|
||||
# requires RouterOS, version=7.18
|
||||
#
|
||||
# download and cleanup packages for CAP installation from CAPsMAN
|
||||
# https://rsc.eworm.de/doc/capsman-download-packages.md
|
||||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
:global CleanFilePath;
|
||||
:global DownloadPackage;
|
||||
:global FileGet;
|
||||
:global LogPrint;
|
||||
:global MkDir;
|
||||
:global RmFile;
|
||||
|
|
@ -42,7 +43,7 @@
|
|||
:error false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /file/find where name=$PackagePath type="directory" ] ] = 0) do={
|
||||
:if ([ $FileGet $PackagePath ] = false) do={
|
||||
:if ([ $MkDir $PackagePath ] = false) do={
|
||||
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
||||
$PackagePath . ") failed!");
|
||||
|
|
@ -53,8 +54,8 @@
|
|||
"). Please place your packages!");
|
||||
}
|
||||
|
||||
:foreach Package in=[ /file/find where type=package \
|
||||
package-version!=$InstalledVersion name~("^" . $PackagePath) ] do={
|
||||
:foreach Package in=[ /file/find recursive where path=$PackagePath \
|
||||
type="package" package-version!=$InstalledVersion ] do={
|
||||
:local File [ /file/get $Package ];
|
||||
:if ($File->"package-architecture" = "mips") do={
|
||||
:set ($File->"package-architecture") "mipsbe";
|
||||
|
|
@ -66,7 +67,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
:if ([ :len [ /file/find where type=package name~("^" . $PackagePath) ] ] = 0) do={
|
||||
:if ([ :len [ /file/find recursive where path=$PackagePath type="package" ] ] = 0) do={
|
||||
$LogPrint info $ScriptName ("No packages available, downloading default set.");
|
||||
:foreach Arch in={ "arm"; "mipsbe" } do={
|
||||
:foreach Package in={ "routeros"; "wireless" } do={
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.15
|
||||
# requires RouterOS, version=7.18
|
||||
#
|
||||
# download and cleanup packages for CAP installation from CAPsMAN
|
||||
# https://rsc.eworm.de/doc/capsman-download-packages.md
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
:global CleanFilePath;
|
||||
:global DownloadPackage;
|
||||
:global FileGet;
|
||||
:global LogPrint;
|
||||
:global MkDir;
|
||||
:global RmFile;
|
||||
|
|
@ -44,7 +45,7 @@
|
|||
:error false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /file/find where name=$PackagePath type="directory" ] ] = 0) do={
|
||||
:if ([ $FileGet $PackagePath ] = false) do={
|
||||
:if ([ $MkDir $PackagePath ] = false) do={
|
||||
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
||||
$PackagePath . ") failed!");
|
||||
|
|
@ -55,8 +56,8 @@
|
|||
"). Please place your packages!");
|
||||
}
|
||||
|
||||
:foreach Package in=[ /file/find where type=package \
|
||||
package-version!=$InstalledVersion name~("^" . $PackagePath) ] do={
|
||||
:foreach Package in=[ /file/find recursive where path=$PackagePath \
|
||||
type="package" package-version!=$InstalledVersion ] do={
|
||||
:local File [ /file/get $Package ];
|
||||
:if ($File->"package-architecture" = "mips") do={
|
||||
:set ($File->"package-architecture") "mipsbe";
|
||||
|
|
@ -68,7 +69,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
:if ([ :len [ /file/find where type=package name~("^" . $PackagePath) ] ] = 0) do={
|
||||
:if ([ :len [ /file/find recursive where path=$PackagePath type="package" ] ] = 0) do={
|
||||
$LogPrint info $ScriptName ("No packages available, downloading default set.");
|
||||
# NOT /interface/wifi/ #
|
||||
:foreach Arch in={ "arm"; "mipsbe" } do={
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.15
|
||||
# requires RouterOS, version=7.18
|
||||
#
|
||||
# download and cleanup packages for CAP installation from CAPsMAN
|
||||
# https://rsc.eworm.de/doc/capsman-download-packages.md
|
||||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
:global CleanFilePath;
|
||||
:global DownloadPackage;
|
||||
:global FileGet;
|
||||
:global LogPrint;
|
||||
:global MkDir;
|
||||
:global RmFile;
|
||||
|
|
@ -42,7 +43,7 @@
|
|||
:error false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /file/find where name=$PackagePath type="directory" ] ] = 0) do={
|
||||
:if ([ $FileGet $PackagePath ] = false) do={
|
||||
:if ([ $MkDir $PackagePath ] = false) do={
|
||||
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
||||
$PackagePath . ") failed!");
|
||||
|
|
@ -53,8 +54,8 @@
|
|||
"). Please place your packages!");
|
||||
}
|
||||
|
||||
:foreach Package in=[ /file/find where type=package \
|
||||
package-version!=$InstalledVersion name~("^" . $PackagePath) ] do={
|
||||
:foreach Package in=[ /file/find recursive where path=$PackagePath \
|
||||
type="package" package-version!=$InstalledVersion ] do={
|
||||
:local File [ /file/get $Package ];
|
||||
:if ($File->"package-architecture" = "mips") do={
|
||||
:set ($File->"package-architecture") "mipsbe";
|
||||
|
|
@ -66,7 +67,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
:if ([ :len [ /file/find where type=package name~("^" . $PackagePath) ] ] = 0) do={
|
||||
:if ([ :len [ /file/find recursive where path=$PackagePath type="package" ] ] = 0) do={
|
||||
$LogPrint info $ScriptName ("No packages available, downloading default set.");
|
||||
:foreach Arch in={ "arm"; "arm64" } do={
|
||||
:local Packages { "arm"={ "routeros"; "wifi-qcom"; "wifi-qcom-ac" };
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
:global EscapeForRegEx;
|
||||
:global FetchUserAgentStr;
|
||||
:global LogPrint;
|
||||
:global RebootForUpdate;
|
||||
:global ScriptFromTerminal;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
|
|
@ -62,9 +63,14 @@
|
|||
$WaitFullyConnected;
|
||||
|
||||
:if ([ :len [ /system/scheduler/find where name="_RebootForUpdate" ] ] > 0) do={
|
||||
$LogPrint info $ScriptName ("A reboot for update is already scheduled.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:if ([ :typeof $RebootForUpdate ] = "nothing") do={
|
||||
$LogPrint info $ScriptName ("Found a stale scheduler for reboot, removing.");
|
||||
/system/scheduler/remove "_RebootForUpdate";
|
||||
} else={
|
||||
$LogPrint info $ScriptName ("A reboot for update is already scheduled.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
}
|
||||
|
||||
$LogPrint debug $ScriptName ("Checking for updates...");
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ Download packages for CAP upgrade from CAPsMAN
|
|||
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
||||
[](https://github.com/eworm-de/routeros-scripts/network)
|
||||
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
||||
[](https://mikrotik.com/download/changelogs/)
|
||||
[](https://mikrotik.com/download/changelogs/)
|
||||
[](https://t.me/routeros_scripts)
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ Configuration
|
|||
|
||||
The configuration goes to `global-config-overlay`, this is the only parameter:
|
||||
|
||||
* `PackagesUpdateDeferReboot`: defer the reboot for night (between 3 AM
|
||||
and 5 AM)
|
||||
* `PackagesUpdateDeferReboot`: defer the reboot for night (between 3 AM and
|
||||
5 AM), use a numerical value in days suffixed with a `d` to defer further
|
||||
|
||||
By modifying the scheduler's `start-time` you can force the reboot at
|
||||
different time.
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@
|
|||
:global ExitError;
|
||||
:global FetchHuge;
|
||||
:global FetchUserAgentStr;
|
||||
:global FileExists;
|
||||
:global FileGet;
|
||||
:global FormatLine;
|
||||
:global FormatMultiLines;
|
||||
:global GetMacVendor;
|
||||
|
|
@ -363,6 +365,7 @@
|
|||
|
||||
:global CertificateAvailable;
|
||||
:global CleanFilePath;
|
||||
:global FileExists;
|
||||
:global LogPrint;
|
||||
:global MkDir;
|
||||
:global RmFile;
|
||||
|
|
@ -383,7 +386,7 @@
|
|||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /file/find where name=$PkgDest type="package" ] ] > 0) do={
|
||||
:if ([ $FileExists $PkgDest "package" ] = true) do={
|
||||
$LogPrint info $0 ("Package file " . $PkgName . " already exists.");
|
||||
:return true;
|
||||
}
|
||||
|
|
@ -405,7 +408,7 @@
|
|||
:return false;
|
||||
}
|
||||
|
||||
:if ([ /file/get [ find where name=$PkgDest ] type ] != "package") do={
|
||||
:if ([ $FileExists $PkgDest "package" ] = false) do={
|
||||
$LogPrint warning $0 ("Downloaded file is not a package, removing.");
|
||||
$RmFile $PkgDest;
|
||||
:return false;
|
||||
|
|
@ -529,6 +532,41 @@
|
|||
$Resource->"architecture-name" . " " . $Caller . "/Fetch (https://rsc.eworm.de/)");
|
||||
}
|
||||
|
||||
# check for existence of file, optionally with type
|
||||
:set FileExists do={
|
||||
:local FileName [ :tostr $1 ];
|
||||
:local Type [ :tostr $2 ];
|
||||
|
||||
:global FileGet;
|
||||
|
||||
:local FileVal [ $FileGet $FileName ];
|
||||
:if ($FileVal = false) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len ($FileVal->"size") ] = 0) do={
|
||||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len $Type ] = 0 || $FileVal->"type" = $Type) do={
|
||||
:return true;
|
||||
}
|
||||
|
||||
:return false;
|
||||
}
|
||||
|
||||
# get file properties in array, or false on error
|
||||
:set FileGet do={
|
||||
:local FileName [ :tostr $1 ];
|
||||
|
||||
:local FileVal false;
|
||||
:do {
|
||||
:set FileVal [ /file/get $FileName ];
|
||||
} on-error={ }
|
||||
|
||||
:return $FileVal;
|
||||
}
|
||||
|
||||
# format a line for output
|
||||
:set FormatLine do={
|
||||
:local Key [ :tostr $1 ];
|
||||
|
|
@ -880,6 +918,7 @@
|
|||
:local Path [ :tostr $1 ];
|
||||
|
||||
:global CleanFilePath;
|
||||
:global FileGet;
|
||||
:global LogPrint;
|
||||
:global RmDir;
|
||||
:global WaitForFile;
|
||||
|
|
@ -917,7 +956,8 @@
|
|||
|
||||
$LogPrint debug $0 ("Making directory: " . $Path);
|
||||
|
||||
:if ([ :len [ /file/find where name=$Path type="directory" ] ] = 1) do={
|
||||
:local PathVal [ $FileGet $Path ];
|
||||
:if ($PathVal->"type" = "directory") do={
|
||||
$LogPrint debug $0 ("... which already exists.");
|
||||
:return true;
|
||||
}
|
||||
|
|
@ -1042,25 +1082,26 @@
|
|||
:set RmDir do={
|
||||
:local DirName [ :tostr $1 ];
|
||||
|
||||
:global FileGet;
|
||||
:global LogPrint;
|
||||
|
||||
$LogPrint debug $0 ("Removing directory: ". $DirName);
|
||||
|
||||
:if ([ :len [ /file/find where name=$DirName type!=directory ] ] > 0) do={
|
||||
$LogPrint error $0 ("Directory '" . $DirName . "' is not a directory.");
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local Dir [ /file/find where name=$DirName type=directory ];
|
||||
:if ([ :len $Dir ] = 0) do={
|
||||
:local DirVal [ $FileGet $DirName ];
|
||||
:if ($DirVal = false) do={
|
||||
$LogPrint debug $0 ("... which does not exist.");
|
||||
:return true;
|
||||
}
|
||||
|
||||
:if ($DirVal->"type" != "directory") do={
|
||||
$LogPrint error $0 ("Directory '" . $DirName . "' is not a directory.");
|
||||
:return false;
|
||||
}
|
||||
|
||||
:onerror Err {
|
||||
/file/remove $Dir;
|
||||
/file/remove $DirName;
|
||||
} do={
|
||||
$LogPrint error $0 ("Removing directory '" . $DirName . "' (" . $Dir . ") failed: " . $Err);
|
||||
$LogPrint error $0 ("Removing directory '" . $DirName . "' failed: " . $Err);
|
||||
:return false;
|
||||
}
|
||||
:return true;
|
||||
|
|
@ -1070,25 +1111,26 @@
|
|||
:set RmFile do={
|
||||
:local FileName [ :tostr $1 ];
|
||||
|
||||
:global FileGet;
|
||||
:global LogPrint;
|
||||
|
||||
$LogPrint debug $0 ("Removing file: ". $FileName);
|
||||
|
||||
:if ([ :len [ /file/find where name=$FileName (type=directory or type=disk) ] ] > 0) do={
|
||||
$LogPrint error $0 ("File '" . $FileName . "' is not a file.");
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local File [ /file/find where name=$FileName !(type=directory or type=disk) ];
|
||||
:if ([ :len $File ] = 0) do={
|
||||
:local FileVal [ $FileGet $FileName ];
|
||||
:if ($FileVal = false) do={
|
||||
$LogPrint debug $0 ("... which does not exist.");
|
||||
:return true;
|
||||
}
|
||||
|
||||
:if ($FileVal->"type" = "directory" || $FileVal->"type" = "disk") do={
|
||||
$LogPrint error $0 ("File '" . $FileName . "' is not a file.");
|
||||
:return false;
|
||||
}
|
||||
|
||||
:onerror Err {
|
||||
/file/remove $File;
|
||||
/file/remove $FileName;
|
||||
} do={
|
||||
$LogPrint error $0 ("Removing file '" . $FileName . "' (" . $File . ") failed: " . $Err);
|
||||
$LogPrint error $0 ("Removing file '" . $FileName . "' failed: " . $Err);
|
||||
:return false;
|
||||
}
|
||||
:return true;
|
||||
|
|
@ -1729,25 +1771,14 @@
|
|||
:global MAX;
|
||||
|
||||
:set FileName [ $CleanFilePath $FileName ];
|
||||
:local I 1;
|
||||
:local Delay ([ $MAX [ $EitherOr $WaitTime 2s ] 100ms ] / 10);
|
||||
|
||||
:while ([ :len [ /file/find where name=$FileName ] ] = 0) do={
|
||||
:if ($I >= 10) do={
|
||||
:return false;
|
||||
}
|
||||
:delay $Delay;
|
||||
:set I ($I + 1);
|
||||
}
|
||||
|
||||
:while ([ :len [ /file/find where name=$FileName ] ] > 0) do={
|
||||
:do {
|
||||
:do {
|
||||
:retry {
|
||||
/file/get $FileName;
|
||||
:return true;
|
||||
} on-error={ }
|
||||
:delay $Delay;
|
||||
:set Delay ($Delay * 3 / 2);
|
||||
}
|
||||
} delay=$Delay max=10;
|
||||
} on-error={ }
|
||||
|
||||
:return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,9 +40,11 @@
|
|||
|
||||
:global EitherOr;
|
||||
:global EMailGenerateFrom;
|
||||
:global FileExists;
|
||||
:global IsDNSResolving;
|
||||
:global IsTimeSync;
|
||||
:global LogPrint;
|
||||
:global RmFile;
|
||||
|
||||
:local AllDone true;
|
||||
:local QueueLen [ :len $EmailQueue ];
|
||||
|
|
@ -93,7 +95,7 @@
|
|||
:onerror Err {
|
||||
:local Attach ({});
|
||||
:foreach File in=[ :toarray [ $EitherOr ($Message->"attach") "" ] ] do={
|
||||
:if ([ :len [ /file/find where name=$File ] ] = 1) do={
|
||||
:if ([ $FileExists $File ] = true) do={
|
||||
:set Attach ($Attach, $File);
|
||||
} else={
|
||||
$LogPrint warning $0 ("File '" . $File . "' does not exist, can not attach.");
|
||||
|
|
@ -110,7 +112,7 @@
|
|||
:set Wait false;
|
||||
:if (($Message->"remove-attach") = true) do={
|
||||
:foreach File in=$Attach do={
|
||||
/file/remove $File;
|
||||
$RmFile $File;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@
|
|||
:local User [ :tostr $2 ];
|
||||
|
||||
:global EitherOr;
|
||||
:global FileExists;
|
||||
:global LogPrint;
|
||||
:global ParseKeyValueStore;
|
||||
:global SSHKeysImport;
|
||||
|
|
@ -84,8 +85,7 @@
|
|||
:return false;
|
||||
}
|
||||
|
||||
:local File [ /file/find where name=$FileName ];
|
||||
:if ([ :len $File ] = 0) do={
|
||||
:if ([ $FileExists $FileName ] = true) do={
|
||||
$LogPrint warning $0 ("File '" . $FileName . "' does not exist.");
|
||||
:return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,19 +31,24 @@
|
|||
:local Schedule do={
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
|
||||
:global PackagesUpdateDeferReboot;
|
||||
|
||||
:global GetRandomNumber;
|
||||
:global IfThenElse;
|
||||
:global LogPrint;
|
||||
|
||||
:global RebootForUpdate do={
|
||||
/system/reboot;
|
||||
}
|
||||
|
||||
:local Interval [ $IfThenElse ($PackagesUpdateDeferReboot >= 1d) $PackagesUpdateDeferReboot 1d ];
|
||||
:local StartTime [ :tostr [ :totime (10800 + [ $GetRandomNumber 7200 ]) ] ];
|
||||
/system/scheduler/add name="_RebootForUpdate" start-time=$StartTime interval=1d \
|
||||
/system/scheduler/add name="_RebootForUpdate" start-time=$StartTime interval=$Interval \
|
||||
on-event=("/system/scheduler/remove \"_RebootForUpdate\"; " . \
|
||||
":global RebootForUpdate; \$RebootForUpdate;");
|
||||
$LogPrint info $ScriptName ("Scheduled reboot for update at " . $StartTime . \
|
||||
" local time (" . [ /system/clock/get time-zone-name ] . ").");
|
||||
" local time (" . [ /system/clock/get time-zone-name ] . ")" . \
|
||||
[ $IfThenElse ($Interval > 1d) (" deferred by " . $Interval) ] . ".");
|
||||
:return true;
|
||||
}
|
||||
|
||||
|
|
@ -153,7 +158,7 @@
|
|||
:error true;
|
||||
}
|
||||
} else={
|
||||
:if ($PackagesUpdateDeferReboot = true) do={
|
||||
:if ($PackagesUpdateDeferReboot = true || $PackagesUpdateDeferReboot >= 1d) do={
|
||||
$Schedule $ScriptName;
|
||||
:set ExitOK true;
|
||||
:error true;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
:global CertificateAvailable;
|
||||
:global EitherOr;
|
||||
:global EscapeForRegEx;
|
||||
:global FileExists;
|
||||
:global GetRandom20CharAlNum;
|
||||
:global IfThenElse;
|
||||
:global LogPrint;
|
||||
|
|
@ -154,7 +155,7 @@
|
|||
:if ([ $WaitForFile ($File . ".done") [ $EitherOr $TelegramChatRunTime 20s ] ] = false) do={
|
||||
:set State ([ $SymbolForNotification "warning-sign" ] . "The command did not finish, still running in background.\n\n");
|
||||
}
|
||||
:if ([ :len [ /file/find where name=($File . ".failed") ] ] > 0) do={
|
||||
:if ([ $FileExists ($File . ".failed") ] = true) do={
|
||||
:set State ([ $SymbolForNotification "cross-mark" ] . "The command failed with an error!\n\n");
|
||||
}
|
||||
:local Content ([ /file/read chunk-size=32768 file=$File as-value ]->"data");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue