mirror of
https://github.com/pothi/mikrotik-lte-scripts.git
synced 2026-01-26 19:49:34 +00:00
Delay as variable
This commit is contained in:
parent
21c3b39845
commit
90f495761c
1 changed files with 5 additions and 2 deletions
|
|
@ -13,6 +13,8 @@
|
||||||
# Note: The SMS is removed from the inbox after sent by Email and forwarded
|
# Note: The SMS is removed from the inbox after sent by Email and forwarded
|
||||||
# even if email and forward fail! So, test it often!
|
# even if email and forward fail! So, test it often!
|
||||||
|
|
||||||
|
:local delayDuration 5s
|
||||||
|
|
||||||
:global adminEmail
|
:global adminEmail
|
||||||
:if ([:typeof $adminEmail] = "nothing" || $adminEmail = "") do={
|
:if ([:typeof $adminEmail] = "nothing" || $adminEmail = "") do={
|
||||||
:log error "adminEmail is not defined or nil."; :error "Error: Check the log"; }
|
:log error "adminEmail is not defined or nil."; :error "Error: Check the log"; }
|
||||||
|
|
@ -39,12 +41,13 @@
|
||||||
:do {
|
:do {
|
||||||
/tool sms send lte1 phone-number=$smsForwardPh message=$smsMessage
|
/tool sms send lte1 phone-number=$smsForwardPh message=$smsMessage
|
||||||
} on-error={ /tool e-mail send to="$adminEmail" subject="Sending SMS Failed" body="Check the log" }
|
} on-error={ /tool e-mail send to="$adminEmail" subject="Sending SMS Failed" body="Check the log" }
|
||||||
:delay 2s
|
:delay delayDuration
|
||||||
|
|
||||||
# Send Email to $adminEmail
|
# Send Email to $adminEmail
|
||||||
/tool e-mail send to="$adminEmail" body="$smsMessage" \
|
/tool e-mail send to="$adminEmail" body="$smsMessage" \
|
||||||
subject="SMS from $smsPhone at $smsTimeStamp"
|
subject="SMS from $smsPhone at $smsTimeStamp"
|
||||||
:delay 3s
|
:delay delayDuration
|
||||||
|
|
||||||
remove $i
|
remove $i
|
||||||
|
:delay delayDuration
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue