-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·104 lines (90 loc) · 3.86 KB
/
install.sh
File metadata and controls
executable file
·104 lines (90 loc) · 3.86 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
# install.sh - Install update-beeper scripts
#
# Quick installation (pipes directly to bash):
# curl -fsSL https://raw.githubusercontent.com/beeper-community/update-beeper/master/install.sh | bash
#
# Safer two-step installation (recommended - allows script review):
# curl -fsSL https://raw.githubusercontent.com/beeper-community/update-beeper/master/install.sh -o /tmp/install.sh
# less /tmp/install.sh # Review the script before running
# bash /tmp/install.sh
#
# Or clone and run (safest - full source inspection):
# git clone https://github.com/beeper-community/update-beeper.git
# cd update-beeper
# ./install.sh
#
# Verify checksums (optional but recommended for remote installs):
# curl -fsSL https://raw.githubusercontent.com/beeper-community/update-beeper/master/checksums.sha256 -o /tmp/checksums.sha256
# cd ~/.local/bin && sha256sum -c /tmp/checksums.sha256 --ignore-missing
set -euo pipefail
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# Error handler
error_exit() {
echo -e "${RED}Error: $1${NC}" >&2
exit 1
}
REPO="https://raw.githubusercontent.com/beeper-community/update-beeper/master"
INSTALL_DIR="${HOME}/.local/bin"
echo -e "${BLUE}🐝 Installing update-beeper...${NC}"
echo ""
# Check dependencies
command -v curl &>/dev/null || error_exit "curl is required but not installed"
# Create install directory if needed
mkdir -p "$INSTALL_DIR" || error_exit "Failed to create $INSTALL_DIR"
# Check if we're running from a cloned repo or via curl
if [[ -f "update-beeper" ]] && [[ -f "beeper-version" ]]; then
# Local install from cloned repo
echo " Installing from local files..."
cp update-beeper "$INSTALL_DIR/" || error_exit "Failed to copy update-beeper"
cp beeper-version "$INSTALL_DIR/" || error_exit "Failed to copy beeper-version"
cp beeper-health "$INSTALL_DIR/" || error_exit "Failed to copy beeper-health"
else
# Remote install via curl
echo " Downloading update-beeper..."
curl -fsSL "$REPO/update-beeper" -o "$INSTALL_DIR/update-beeper" || error_exit "Failed to download update-beeper"
echo " Downloading beeper-version..."
curl -fsSL "$REPO/beeper-version" -o "$INSTALL_DIR/beeper-version" || error_exit "Failed to download beeper-version"
echo " Downloading beeper-health..."
curl -fsSL "$REPO/beeper-health" -o "$INSTALL_DIR/beeper-health" || error_exit "Failed to download beeper-health"
fi
# Make executable
chmod +x "$INSTALL_DIR/update-beeper" || error_exit "Failed to make update-beeper executable"
chmod +x "$INSTALL_DIR/beeper-version" || error_exit "Failed to make beeper-version executable"
chmod +x "$INSTALL_DIR/beeper-health" || error_exit "Failed to make beeper-health executable"
echo ""
echo -e "${GREEN}✓ Installed successfully!${NC}"
echo ""
echo " Scripts installed to: $INSTALL_DIR"
echo ""
# Check if install dir is in PATH
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
echo -e "${YELLOW}⚠ $INSTALL_DIR is not in your PATH${NC}"
echo ""
echo " Add this to your ~/.bashrc or ~/.zshrc:"
echo ""
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
echo ""
else
echo " Commands available:"
echo " update-beeper - Update Beeper to latest version"
echo " beeper-version - Check version status"
echo " beeper-health - Monitor Beeper + validate desktop shortcut"
fi
echo ""
echo -e "${BLUE}Optional: Set up automatic updates${NC}"
echo ""
echo " # Copy systemd user files"
echo " mkdir -p ~/.config/systemd/user"
echo " curl -fsSL $REPO/systemd/update-beeper-user.service -o ~/.config/systemd/user/update-beeper.service"
echo " curl -fsSL $REPO/systemd/update-beeper-user.timer -o ~/.config/systemd/user/update-beeper.timer"
echo ""
echo " # Enable the timer"
echo " systemctl --user daemon-reload"
echo " systemctl --user enable --now update-beeper.timer"
echo ""