summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve McIntyre <steve.mcintyre@pexip.com>2023-10-04 14:47:47 +0100
committerSteve McIntyre <steve.mcintyre@pexip.com>2023-10-04 14:47:47 +0100
commitdcd473b2f14a373db89b026ea10e36012218d247 (patch)
tree5105e3031a09c49b5a6fbf4950a828ed0888786c
parent8b4c7a1f39bc7f9b26864eb1129e81c6ceb37d92 (diff)
downloadsteve-scripts-dcd473b2f14a373db89b026ea10e36012218d247.zip
Fiox up VPN config to be better configurable
-rwxr-xr-xmyvpn7
-rwxr-xr-xvpn-start6
2 files changed, 10 insertions, 3 deletions
diff --git a/myvpn b/myvpn
index 14f8280..2cbf8be 100755
--- a/myvpn
+++ b/myvpn
@@ -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
diff --git a/vpn-start b/vpn-start
index 99f32fe..fd1a79d 100755
--- a/vpn-start
+++ b/vpn-start
@@ -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"