Skip to content

Instantly share code, notes, and snippets.

@Enelar
Created December 7, 2016 17:51
Show Gist options
  • Save Enelar/04077c0de8b417a5a68cd80d887ad1f4 to your computer and use it in GitHub Desktop.
Save Enelar/04077c0de8b417a5a68cd80d887ad1f4 to your computer and use it in GitHub Desktop.
Workaround lgsosc.com bugs /etc/NetworkManager/dispatcher.d/
#!/bin/bash
IF=$1
STATUS=$2
if [ "$IF" == "vpn0" ]
then
case "$2" in
up)
logger -s "ELEVATE VPN triggered"
regex="inet\s(.*?)\s+netmask"
if [[ `ifconfig $IF` =~ $regex ]]
then
ip="${BASH_REMATCH[1]}"
echo "ELEVATE VPN IP $ip"
else
logger -s "ELEVATE VPN failed"
exit
fi
ifconfig $IF $ip netmask 255.0.0.0
;;
*)
;;
esac
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment