-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathlinux.sh
48 lines (43 loc) · 1.42 KB
/
linux.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
#!/bin/bash
# Function to detect OS
detect_os() {
if [ -f /etc/os-release ]; then
. /etc/os-release
OS_NAME=$ID
else
echo "Unable to detect OS."
exit 1
fi
}
# Function to install Chromium and ChromiumDriver
install_chromium() {
echo "Detected OS: $OS_NAME"
case "$OS_NAME" in
ubuntu | debian | kali)
echo "Installing Chromium and ChromiumDriver on $OS_NAME..."
sudo apt update
sudo apt install -y chromium chromium-driver
;;
pop | neon | zorin | elementary | linuxmint)
echo "Installing Chromium and ChromiumDriver on $OS_NAME (Ubuntu-based)..."
sudo apt update
sudo apt install -y chromium-browser chromium-chromedriver
;;
*)
echo "OS $OS_NAME is not directly supported by this script."
echo "Please install Chromium and ChromiumDriver manually for your OS."
exit 1
;;
esac
# Verify installation
if command -v chromium >/dev/null 2>&1 && command -v chromedriver >/dev/null 2>&1; then
echo "Chromium and ChromiumDriver installed successfully."
echo "Chromium version: $(chromium --version)"
echo "ChromiumDriver version: $(chromedriver --version)"
else
echo "Installation failed. Please check for errors and try manually."
fi
}
# Main script execution
detect_os
install_chromium