diff options
author | Steve McIntyre <steve.mcintyre@pexip.com> | 2023-10-04 14:47:47 +0100 |
---|---|---|
committer | Steve McIntyre <steve.mcintyre@pexip.com> | 2023-10-04 14:47:47 +0100 |
commit | dcd473b2f14a373db89b026ea10e36012218d247 (patch) | |
tree | 5105e3031a09c49b5a6fbf4950a828ed0888786c | |
parent | 8b4c7a1f39bc7f9b26864eb1129e81c6ceb37d92 (diff) | |
download | steve-scripts-dcd473b2f14a373db89b026ea10e36012218d247.zip |
Fiox up VPN config to be better configurable
-rwxr-xr-x | myvpn | 7 | ||||
-rwxr-xr-x | vpn-start | 6 |
2 files changed, 10 insertions, 3 deletions
@@ -1,5 +1,8 @@ #!/bin/sh +SERVER=corp-no-ssl.rd.pexip.com +PORT=10443 + if [ $(id -u) -eq 0 ]; then echo "Do not run this script as root" exit 1 @@ -7,9 +10,9 @@ fi cd /home/steve/openfortivpn/openfortivpn-webview/openfortivpn-webview-electron/ -cookie=$(npm start corp-uk-ssl.rd.pexip.com:10443 2>/dev/null) +cookie=$(npm start "$SERVER:$PORT" 2>/dev/null) if [ $? -ne 0 ]; then # Exit if the browser window has been closed manually. exit 0 fi -echo "$cookie" | sudo /home/steve/bin/vpn-start +echo "$cookie" | sudo /home/steve/bin/vpn-start $SERVER $PORT @@ -1,2 +1,6 @@ #!/bin/sh -openfortivpn --cookie-on-stdin corp-uk-ssl.rd.pexip.com:10443 + +SERVER=$1 +PORT=$2 + +openfortivpn --cookie-on-stdin "$SERVER:$PORT" |