-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinstaller.sh
executable file
·79 lines (65 loc) · 2.07 KB
/
installer.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
install_arch() {
pamac build nordvpn-bin
sudo systemctl enable --now nordvpnd
pamac install xclip
pamac install python-pip
pamac install python-virtualenv
}
install_debian() {
# Install nordvpn
sudo apt install curl
sh <(curl -sSf https://downloads.nordcdn.com/apps/linux/install.sh)
sudo apt update
sudo apt install -y xclip
sudo apt install python3-pip
sudo apt install python3-venv
}
if [ "$EUID" -eq 0 ]
then echo "Please do not run as root. Commands that need root access will request it."
exit
fi
version=$(python3 -V 2>&1 | grep -Po '(?<=Python )(.+)')
if [[ -z "$version" ]]; then
echo "No Python3 detected. Install Python3 to install"
exit
fi
echo $version
source /etc/lsb-release
if [ -f "/etc/arch-release" ]; then
install_arch
elif [ -f "/etc/debian-version" ]; then
install_debian
else
echo -e "This program only officially supports Arch and Debian based distros, you require these dependencies \n[python3-venv, python3-pip, xclip, https://nordvpn.com/download/linux/] \nIf you would like to continue with the install and install the dependencies yourself enter Y \notherwise press anykey to exit the installer"
read continue
if [[ $continue != "y" ]] && [[ $continue != "Y" ]]; then
echo "exiting installer"
exit
fi
fi
sudo usermod -aG nordvpn $USER
python3 -m venv venv
source venv/bin/activate
pip install wheel
pip install -r requirements.txt
echo "Creating desktop Icon"
FILE_NAME="${PWD}/NordVPN.desktop"
echo ${FILE_NAME}
touch NordVPN.desktop
cat > $FILE_NAME <<EOF
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=${PWD}/NordVPNLinuxGUI.sh
Name=NordVPN
Icon=${PWD}/icon.jpg
X-Desktop-File-Install-Version=0.24
EOF
sudo cp $FILE_NAME /usr/share/applications/NordVPN.desktop
sudo cp /usr/share/applications/NordVPN.desktop "$(xdg-user-dir DESKTOP)/NordVPN.desktop"
sudo chown $USER "$(xdg-user-dir DESKTOP)/NordVPN.desktop"
echo "Finished Installation"
echo "To Enable desktop launching, right click on the NordVPN.desktop cog Icon and right click and select 'Allow Launching'"