-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto_setup.sh
executable file
·56 lines (49 loc) · 1.43 KB
/
auto_setup.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
#!/bin/bash
# Determine OS
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [[ "$EUID" -ne 0 ]]; then
echo "Please run as root (use sudo)"
exit
fi
update_cmd="sudo apt-get update"
install_cmd="sudo apt-get install -y"
pip_install="python3-pip"
gcc_install="build-essential"
openssl_install="libssl-dev"
elif [[ "$OSTYPE" == "darwin"* ]]; then
# Checking for Homebrew installation
if ! command -v brew &>/dev/null; then
echo "Homebrew not installed. Please install Homebrew."
exit 1
fi
update_cmd="brew update"
install_cmd="brew install"
gcc_install="gcc"
openssl_install="openssl@3"
else
echo "Unsupported operating system."
exit 1
fi
# Update package lists
echo "Updating package lists..."
$update_cmd
# Install pip
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "Installing pip..."
$install_cmd $pip_install
fi
# Install Python dependencies using pip
echo "Installing Python dependencies..."
if [[ "$OSTYPE" == "darwin"* ]]; then
# Ensure pip3 is used without sudo on macOS
pip3 install --user ecdsa coincurve pynacl
else
sudo pip3 install ecdsa coincurve pynacl
fi
# Install GCC for compiling C++ code
echo "Installing GCC..."
$install_cmd $gcc_install
# Install OpenSSL for cryptographic operations
echo "Installing OpenSSL..."
$install_cmd $openssl_install
echo "All dependencies installed successfully. You can now run the e-SeaFL system."