mirror of
https://github.com/pothi/mikrotik-lte-scripts.git
synced 2025-07-24 12:45:07 +02:00
Migrate scripts from mikrotik-scripts repo and make further improvements for the first commit!
This commit is contained in:
parent
bd0215876c
commit
3d3ddb191b
7 changed files with 615 additions and 2 deletions
40
scripts/sim-toggle.rsc
Normal file
40
scripts/sim-toggle.rsc
Normal file
|
@ -0,0 +1,40 @@
|
|||
# Toggle SIM Slot in LTE Modem.
|
||||
|
||||
# Applicable for RouterOS above 6.45.1
|
||||
# see https://wiki.mikrotik.com/wiki/Dual_SIM_Application#Initial_settings
|
||||
# see https://forum.mikrotik.com/viewtopic.php?f=13&t=159520&p=816964#p816964
|
||||
|
||||
:log info "\nSIM toggled by the script..."
|
||||
|
||||
/system routerboard modem
|
||||
|
||||
:local oldSlot [get sim-slot]
|
||||
:local newSlot
|
||||
:local oldOperator
|
||||
:local newOperator
|
||||
|
||||
:if ( $oldSlot = "a" ) do={
|
||||
:set $newSlot "b"
|
||||
:set $oldOperator "BSNL"
|
||||
:set $newOperator "Airtel"
|
||||
} else={
|
||||
:set $newSlot "a"
|
||||
:set $oldOperator "Airtel"
|
||||
:set $newOperator "BSNL"
|
||||
}
|
||||
|
||||
set sim-slot=$newSlot
|
||||
|
||||
# Speed restrictions enable / disable
|
||||
:if ( $newOperator = "Airtel" ) do={
|
||||
/queue simple enable Airtel
|
||||
/ip firewall filter disable [find action=fasttrack-connection]
|
||||
} else={
|
||||
/queue simple disable Airtel
|
||||
/ip firewall filter enable [find action=fasttrack-connection]
|
||||
}
|
||||
|
||||
:log warning "LTE SIM SLOT will change from $oldSlot to $newSlot";
|
||||
:log warning "LTE SIM SLOT will change from $oldOperator to $newOperator";
|
||||
:log info "Please hold on while switching SIM. Internet will come back in a few seconds."
|
||||
:delay 2s
|
Loading…
Add table
Add a link
Reference in a new issue