mirror of
https://github.com/gbudny93/RouterOS_Useful_Scripts.git
synced 2025-06-24 18:58:37 +02:00
Initial Commit.
This commit is contained in:
parent
084702913b
commit
feb039011d
1 changed files with 31 additions and 0 deletions
31
RouterOS_Script_Fetch.rsc
Normal file
31
RouterOS_Script_Fetch.rsc
Normal file
|
@ -0,0 +1,31 @@
|
|||
# RouterOS Function
|
||||
# Copyright (c) Grzegorz Budny
|
||||
# Fetches RouterOS script from external https location and runs it or creates schedule task
|
||||
|
||||
:global FetchScript do={
|
||||
|
||||
tool fetch mode=https http-method=get url=$url dst-path=($destinationPath."/".$destinationFileName);
|
||||
|
||||
:if($isRun)do={
|
||||
|
||||
/system script run ($destinationPath.$destinationFileName);
|
||||
|
||||
}
|
||||
:if($isSchedule)do={
|
||||
|
||||
/system scheduler \
|
||||
add interval=($interval.h) name=$taskName on-event=("system script run ".($destinationPath."/".$destinationFileName)) \
|
||||
policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
|
||||
start-date=jan/01/1970 start-time=$startTime;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#$FetchScript url="https://example.repo.com" destinationPath="FolderName" destinationFileName="ScriptName"
|
||||
|
||||
#$FetchScript url="https://example.repo.com" destinationPath="FolderName" destinationFileName="ScriptName" isRun=true
|
||||
|
||||
#$FetchScript url="https://example.repo.com" destinationPath="FolderName" destinationFileName="ScriptName" isSchedule=true\
|
||||
#interval="24" taskName="TaskName" startTime="startup"
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue