-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·53 lines (44 loc) · 1.23 KB
/
install.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
#!/bin/bash
# Function to check if a command is available
command_exists() {
command -v "$1" &>/dev/null
}
# Function to check if the user has root privileges
check_root() {
if [[ $EUID -ne 0 ]]; then
echo "This script requires root privileges. Please run it with 'sudo'."
exit 1
fi
}
# Check for root privileges
check_root
# Check for Python 3
if command_exists python3; then
echo "Python 3 is already installed."
else
echo "Python 3 is not installed. Installing..."
sudo apt update
sudo apt install -y python3
fi
# Check for pip3 (for Python 3)
if command_exists pip3; then
echo "pip3 is already installed."
else
echo "pip3 is not installed. Installing..."
sudo apt install -y python3-pip
fi
if command_exists pip; then
echo "pip is already installed."
else
echo "pip is not installed. Installing..."
sudo apt install -y python-pip
fi
if command_exists gnome-terminal; then
echo "Gnome terminal already installed"
else
sudo apt install -y gnome-terminal && sudo apt update && sudo apt upgrade
echo "Gnome terminal installed successfully"
fi
echo "Changing rights for script that starts listener and web server..."
chmod +x ./serve.sh
echo "Everything installed. Happy hacking."