diff options
-rw-r--r-- | script-updates | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/script-updates b/script-updates index f38e46a..cae182d 100644 --- a/script-updates +++ b/script-updates @@ -50,12 +50,16 @@ } :if ([ :len $sourcenew ] > 0) do={ - :local sourcecurrent [ / system script get $script source ]; - :if ($sourcenew = $sourcecurrent) do={ - :log debug ("Script " . $scriptname . " did not change"); + :if ([ :pick $sourcenew 0 5 ] = "#!rsc") do={ + :local sourcecurrent [ / system script get $script source ]; + :if ($sourcenew != $sourcecurrent) do={ + :log info ("Updating script: " . $scriptname); + / system script set owner=$scriptname source=$sourcenew $script; + } else={ + :log debug ("Script " . $scriptname . " did not change"); + } } else={ - :log info ("Updating script: " . $scriptname); - / system script set owner=$scriptname source=$sourcenew $script; + :log warning ("Looks like new script " . $scriptname . " is not valid. Ignoring!"); } } else={ :log debug ("No update for script " . $scriptname); |