-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsysbench.sh
executable file
·29 lines (24 loc) · 947 Bytes
/
sysbench.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
#!/bin/bash
# Check for dependencies and install if missing
packages=(git php-cli php-xml php-gd php-bz2 php-sqlite3 php-curl)
for package in "${packages[@]}"; do
if ! dpkg -s "$package" &> /dev/null; then
echo "Installing missing package: $package"
sudo apt-get install -y "$package"
fi
done
# Clone the Phoronix Test Suite repository if not already cloned
pts_dir="$HOME/phoronix-test-suite"
if [ ! -d "$pts_dir" ]; then
echo "Cloning Phoronix Test Suite..."
git clone https://github.com/phoronix-test-suite/phoronix-test-suite.git "$pts_dir"
fi
# Create alias in .bashrc if not already present
alias_line='alias pts="./phoronix-test-suite/phoronix-test-suite"'
if ! grep -q "$alias_line" "$HOME/.bashrc"; then
echo "Adding 'pts' alias to .bashrc"
echo "$alias_line" >> "$HOME/.bashrc"
# Source .bashrc to make the alias immediately available
source "$HOME/.bashrc"
fi
echo "Setup complete!"