routeros-scripts/ppp-on-up
2019-01-04 20:29:42 +01:00

29 lines
768 B
Plaintext

#!rsc
# RouterOS script: ppp-on-up
# Copyright (c) 2013-2019 Christian Hesse <mail@eworm.de>
#
# run scripts on ppp up
# variable $interface is available in ppp on-up script
:local Interface $interface;
:local IntName [ / interface get $Interface name ];
:log info ("PPP interface " . $IntName . " is up.");
:local DhcpClient [ / ipv6 dhcp-client find where interface=$IntName ];
:if ([ :len $DhcpClient ] > 0) do={
/ ipv6 dhcp-client disable $DhcpClient;
:delay 1s;
/ ipv6 dhcp-client enable $DhcpClient;
}
:local Scripts {
"update-tunnelbroker"
}
:foreach Script in=$Scripts do={
:if ([ / system script print count-only where name=$Script ] > 0) do={
:log debug ("Running script from ppp-on-up: " . $Script);
/ system script run $Script;
}
}