forked from Dragon2fly/vpngate-with-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·28 lines (22 loc) · 696 Bytes
/
Copy pathrun
File metadata and controls
executable file
·28 lines (22 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# allow running from anywhere
# when making an alias in .bashrc or /etc/environment: vpn="path/to/./run"
dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
cd "$(dirname "$(realpath "$0")")";
echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"
user_home=($HOME)
type=$1
arg=$2
if [ "$type" == "cli" ]; then
sudo python3 vpnproxy_cli.py $user_home $arg
else
if [ "$type" != "tui" ]; then
arg=$type
fi
# check if this os is *buntu and launch vpn_indicator
os_id=`cat /proc/version`
target="buntu"
test "${os_id#*$target}" != "$os_id" && stdbuf -oL ./vpn_indicator.py > logs/indicator.log &
sleep 0.2
sudo ./vpnproxy_tui.py $user_home $arg
fi