-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·50 lines (41 loc) · 1.21 KB
/
install.sh
File metadata and controls
executable file
·50 lines (41 loc) · 1.21 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
#!/usr/bin/env bash
#
# install.sh
# Example usage:
# bash install.sh
#
# This script downloads audio2mp3 script and installs it in ~/.local/bin
set -euo pipefail
# CONFIGURATION
SCRIPT_URL="https://raw.githubusercontent.com/homelabshq/tunnelhouse/refs/heads/main/tunnelhouse.sh"
SCRIPT_NAME="tunnelhouse"
# Choose install directory
if [ -d "$HOME/.local/bin" ]; then
TARGET_DIR="$HOME/.local/bin"
else
TARGET_DIR="$HOME/.local/bin"
mkdir -p "$TARGET_DIR"
fi
TARGET_PATH="$TARGET_DIR/$SCRIPT_NAME"
# Download the script
echo "Downloading $SCRIPT_NAME from $SCRIPT_URL..."
curl -fsSL "$SCRIPT_URL" -o "$TARGET_PATH"
# Make it executable
chmod +x "$TARGET_PATH"
echo "Installed '$SCRIPT_NAME' to '$TARGET_PATH'."
# Check if TARGET_DIR is in PATH
case ":$PATH:" in
*":$TARGET_DIR:"*)
echo "✅ '$TARGET_DIR' is already in your PATH."
;;
*)
echo "⚠️ Note: '$TARGET_DIR' is not in your PATH."
echo " You can add it by running:"
echo ""
echo " echo 'export PATH=\"\$PATH:$TARGET_DIR\"' >> ~/.bashrc"
echo " source ~/.bashrc"
echo ""
;;
esac
echo "✅ Installation complete! You can run your script with:"
echo " $SCRIPT_NAME"