Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/vbash
source /opt/vyatta/etc/functions/script-template
SET=${SBIN_PATH}/my_set
COMMIT=${SBIN_PATH}/my_commit
configure
current_set_ipaddr=$($API returnValue vpn l2tp remote-access outside-address)
current_ext_ipaddr=$(echo -n "$(run show interfaces pppoe pppoe0)" | grep inet | cut -d' ' -f6)
echo "${current_set_ipaddr} -> ${current_ext_ipaddr}"
if [ -n "${current_ext_ipaddr}" ]; then
if [ "${current_ext_ipaddr}" != "${current_set_ipaddr}" ]; then
$SET vpn l2tp remote-access outside-address ${current_ext_ipaddr}
$COMMIT
chown -R root:vyattacfg /opt/vyatta/config/active
fi
fi
function atexit()
{
echo exit
exit
}
trap atexit EXIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.