Created
April 6, 2020 20:44
-
-
Save Jickelsen/1b6e4b3ad955864cd38b7be2d631d3b1 to your computer and use it in GitHub Desktop.
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 = "connect" ]; then | |
#turn off WiFi | |
/sbin/ifconfig wlan0 down | |
sleep 5 | |
#connect 4g | |
nmcli device connect cdc-wdm0 | |
nmcli device connect ttyUSB1 | |
sleep 5 | |
#setup VPN | |
/bin/systemctl start tinc@navrelay | |
elif [ $1 = "disconnect" ]; then | |
#teardown VPN | |
/bin/systemctl stop tinc@navrelay | |
sleep 5 | |
#disconnect 4g | |
nmcli device disconnect cdc-wdm0 | |
nmcli device disconnect ttyUSB1 | |
sleep 5 | |
#turn on WiFi | |
/sbin/ifconfig wlan0 up | |
fi 16,35-42 Top |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment