mirror of
https://github.com/pothi/mikrotik-lte-scripts.git
synced 2025-06-20 21:35:46 +02:00
Add init script
This commit is contained in:
parent
43d3d2df7c
commit
5a491164dc
1 changed files with 29 additions and 0 deletions
29
scripts/init.rsc
Normal file
29
scripts/init.rsc
Normal file
|
@ -0,0 +1,29 @@
|
|||
# Initialize the router with default values, run backup scripts and check for updates!
|
||||
|
||||
:global adminEmail "noreply@example.com"
|
||||
:global adminPh 9894998949
|
||||
:global genericLogFileName "genericLog"
|
||||
:global cloudPass ""
|
||||
|
||||
:local waitForDNS do={
|
||||
:local pingIP 1
|
||||
:while ( $pingIP = 1 ) do={ :do { :set pingIP [:resolve g.co] } on-error={ :delay 60s } }
|
||||
}
|
||||
$waitForDNS
|
||||
|
||||
# /system ntp client set enabled=yes
|
||||
:delay 3s
|
||||
|
||||
:log info "\nInit script has started..."
|
||||
|
||||
/system script
|
||||
|
||||
:local commonScripts {"backup-cron"; "backup-scripts"; "cloud-backup"; "firmware-check-rb"; "firmware-check-ros";}
|
||||
:local initScripts ($commonScripts, "firmware-check-lte")
|
||||
|
||||
:foreach scriptName in $initScripts do={
|
||||
:do { run $scriptName } on-error={ :log error "Error running the script $scriptName\n" }
|
||||
:delay 30s
|
||||
}
|
||||
|
||||
:log info "Init script finished execution!\n"
|
Loading…
Add table
Add a link
Reference in a new issue