-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathin.sh
More file actions
67 lines (58 loc) · 1.58 KB
/
Copy pathin.sh
File metadata and controls
67 lines (58 loc) · 1.58 KB
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
#!/bin/bash
#安装必要的包
# Define commands to install
commands=("python3-venv" "python3-pip" "python3" "git" "libcurl4" "libssl-dev" "make" "automake" "autoconf" "m4" "build-essential")
package_manager=""
install_command=""
# Determine the package manager and install command
if [ -x "$(command -v apt)" ]; then
package_manager="apt"
install_command="sudo apt install -y"
elif [ -x "$(command -v yum)" ]; then
package_manager="yum"
install_command="sudo yum install -y"
else
echo "Unsupported package manager."
exit 1
fi
# Function to install missing commands
install_missing_commands() {
for cmd in "${commands[@]}"; do
if ! command -v "$cmd" &>/dev/null; then
echo "Installing $cmd..."
$install_command "$cmd"
if [ $? -eq 0 ]; then
echo "$cmd installed successfully."
else
echo "Failed to install $cmd."
exit 1
fi
else
echo "$cmd is already installed."
fi
done
}
# Check and install missing commands
install_missing_commands
# Clone the GitHub repository
git clone https://github.com/seagullz4/DDOS DDOS
# Create a Python virtual environment
if python3 -m venv love; then
echo "Virtual environment created successfully."
else
echo "Failed to create the virtual environment."
exit 1
fi
# Activate the virtual environment
source love/bin/activate
# Change to the DDOS directory
cd DDOS
# Install Python requirements
if [[ "$VIRTUAL_ENV" != "" ]]; then
pip3 install -r requirements.txt
else
echo "Not in a virtual environment. Activate it first."
exit 1
fi
# Deactivate the virtual environment
deactivate