-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.sh
More file actions
31 lines (23 loc) · 739 Bytes
/
Copy pathinstall.sh
File metadata and controls
31 lines (23 loc) · 739 Bytes
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
#!/bin/bash
# Install BreakingLab globally
set -euo pipefail
# Ensure we are root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root (sudo ./install.sh)"
exit 1
fi
INSTALL_DIR="/usr/local/bin"
SCRIPT_NAME="breakinglab"
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
SOURCE_SCRIPT="$SOURCE_DIR/breakinglab.sh"
echo "Installing BreakingLab from $SOURCE_DIR..."
if [ ! -f "$SOURCE_SCRIPT" ]; then
echo "Error: breakinglab.sh not found in $SOURCE_DIR"
exit 1
fi
# Make executable
chmod +x "$SOURCE_SCRIPT"
# Create symlink
echo "Creating symlink in $INSTALL_DIR/$SCRIPT_NAME..."
ln -sf "$SOURCE_SCRIPT" "$INSTALL_DIR/$SCRIPT_NAME"
echo "Success! You can now run 'breakinglab' from anywhere."