mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-08-04 02:04:39 +02:00
add scripts
This commit is contained in:
parent
1d99dc38ff
commit
e1f134ead5
28 changed files with 842 additions and 0 deletions
26
manage-umts
Normal file
26
manage-umts
Normal file
|
@ -0,0 +1,26 @@
|
|||
# RouterOS script: manage-umts
|
||||
# Copyright (c) 2013-2018 Christian Hesse <mail@eworm.de>
|
||||
#
|
||||
# manage UMTS interface based on ethernet and wireless status
|
||||
|
||||
:local etherint "en1";
|
||||
:local wlanint "wl-station";
|
||||
:local umtsint "t-mobile";
|
||||
|
||||
:local etherstatus [ / interface ethernet get $etherint running ];
|
||||
:local wlanstatus [ / interface wireless get $wlanint running ];
|
||||
|
||||
:if ( $etherstatus = true || wlanstatus = true ) do={
|
||||
:if ( [ / interface get $umtsint disabled ] = false ) do={
|
||||
:log info ("Ethernet (" . $etherint . " / " . $etherstatus . ") or " . \
|
||||
"wireless (" . $wlanint . " / " . $wlanstatus . ") is running, " . \
|
||||
"UMTS interface " . $umtsint . " is enabled. Disabling...");
|
||||
/ interface set disabled=yes $umtsint;
|
||||
};
|
||||
} else={
|
||||
:if ( [ / interface get $umtsint disabled ] = true ) do={
|
||||
:log info ("Neither ethernet (" . $etherint . ") nor wireless (" . $wlanint . ") interface is running, " . \
|
||||
"UMTS interface " . $umtsint . " is disabled. Enabling...");
|
||||
/ interface set disabled=no $umtsint;
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue