-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
61 lines (52 loc) · 1.62 KB
/
install.sh
File metadata and controls
61 lines (52 loc) · 1.62 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
#!/bin/bash
# CleanUbuntu installer script
set -e
INSTALL_DIR="/usr/local/bin"
SCRIPT_NAME="cleanubuntu"
REPO_URL="https://raw.githubusercontent.com/strabo231/cleanubuntu/main/cleanubuntu"
echo "🧹 CleanUbuntu Installer"
echo "======================="
echo ""
# Check if running as root for system-wide install
if [ "$EUID" -eq 0 ]; then
INSTALL_DIR="/usr/local/bin"
echo "Installing system-wide to $INSTALL_DIR"
elif [ -w "$INSTALL_DIR" ]; then
echo "Installing system-wide to $INSTALL_DIR"
else
INSTALL_DIR="$HOME/.local/bin"
echo "Installing to user directory $INSTALL_DIR"
mkdir -p "$INSTALL_DIR"
# Check if ~/.local/bin is in PATH
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
echo ""
echo "⚠️ Note: $HOME/.local/bin is not in your PATH"
echo "Add this line to your ~/.bashrc or ~/.zshrc:"
echo ""
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
echo ""
fi
fi
# Download the script
echo "Downloading cleanubuntu..."
if command -v curl &> /dev/null; then
curl -sSL "$REPO_URL" -o "/tmp/$SCRIPT_NAME"
elif command -v wget &> /dev/null; then
wget -q "$REPO_URL" -O "/tmp/$SCRIPT_NAME"
else
echo "Error: Neither curl nor wget is available"
exit 1
fi
# Make executable and move to install directory
chmod +x "/tmp/$SCRIPT_NAME"
if [ -w "$INSTALL_DIR" ]; then
mv "/tmp/$SCRIPT_NAME" "$INSTALL_DIR/$SCRIPT_NAME"
else
sudo mv "/tmp/$SCRIPT_NAME" "$INSTALL_DIR/$SCRIPT_NAME"
fi
echo "✓ CleanUbuntu installed successfully!"
echo ""
echo "Try it out:"
echo " sudo cleanubuntu --help"
echo " sudo cleanubuntu --analyze"
echo ""