Created
December 7, 2016 17:51
-
-
Save Enelar/04077c0de8b417a5a68cd80d887ad1f4 to your computer and use it in GitHub Desktop.
Workaround lgsosc.com bugs /etc/NetworkManager/dispatcher.d/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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