Skip to content

Instantly share code, notes, and snippets.

@Jickelsen
Created April 6, 2020 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jickelsen/1b6e4b3ad955864cd38b7be2d631d3b1 to your computer and use it in GitHub Desktop.
Save Jickelsen/1b6e4b3ad955864cd38b7be2d631d3b1 to your computer and use it in GitHub Desktop.
#!/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