-
Notifications
You must be signed in to change notification settings - Fork 34
/
browser.sh
119 lines (112 loc) · 3.54 KB
/
browser.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/bash
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo "Docker is not installed."
read -p "Press Enter to install Docker..."
echo "Installing Docker..."
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
rm get-docker.sh
echo "Docker installed successfully."
else
echo "Docker is already installed."
fi
# Function to install Chromium
install_chromium() {
if docker ps -a | grep -q chromium; then
echo "Chromium is already installed."
else
read -p "Enter username for Chromium : " USERNAME
read -sp "Enter password for Chromium : " PASSWORD
echo
echo "Installing Chromium..."
docker run -d \
--name=chromium \
--security-opt seccomp=unconfined `#optional` \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-e CUSTOM_USER=$USERNAME \
-e PASSWORD=$PASSWORD \
-e CHROME_CLI=https://www.youtube.com/@IR_TECH/ `#optional` \
-p 3000:3000 \
-p 3001:3001 \
-v /root/chromium/config:/config \
--shm-size="1gb" \
--restart unless-stopped \
lscr.io/linuxserver/chromium:latest
echo "------------------------------------------------------------------------------------------------"
echo "Chromium installed successfully."
IP=$(hostname -I | awk '{print $1}')
echo " "
echo "Use browser with http://$IP:3000"
fi
}
# Function to uninstall Chromium
uninstall_chromium() {
if docker ps -a | grep -q chromium; then
echo "Uninstalling Chromium..."
docker stop chromium
docker rm chromium
echo "Chromium uninstalled."
else
echo "Chromium is not installed."
fi
}
# Function to install Firefox
install_firefox() {
if docker ps -a | grep -q firefox; then
echo "Firefox is already installed."
else
read -p "Enter username for Firefox : " USERNAME
read -sp "Enter password for Firefox : " PASSWORD
echo
echo "Installing Firefox..."
docker run -d \
--name=firefox \
--security-opt seccomp=unconfined `#optional` \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-e CUSTOM_USER=$USERNAME \
-e PASSWORD=$PASSWORD \
-p 4000:3000 \
-p 4001:3001 \
-v /root/firefox/config:/config \
--shm-size="1gb" \
--restart unless-stopped \
lscr.io/linuxserver/firefox:latest
echo "------------------------------------------------------------------------------------------------"
echo "Firefox installed successfully."
IP=$(hostname -I | awk '{print $1}')
echo " "
echo "Use browser with http://$IP:4000"
fi
}
# Function to uninstall Firefox
uninstall_firefox() {
if docker ps -a | grep -q firefox; then
echo "Uninstalling Firefox..."
docker stop firefox
docker rm firefox
echo "Firefox uninstalled."
else
echo "Firefox is not installed."
fi
}
# Display the menu
echo "Select an option:"
echo "1) Install Chromium"
echo "2) Uninstall Chromium"
echo "3) Install Firefox"
echo "4) Uninstall Firefox"
echo "5) Exit"
read -p "Please choose : " choice
case $choice in
1) install_chromium ;;
2) uninstall_chromium ;;
3) install_firefox ;;
4) uninstall_firefox ;;
5) exit ;;
*) echo "Invalid choice. Please select a valid option." ;;
esac