File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Validate
2+
3+ on :
4+ push :
5+ pull_request :
6+
7+ jobs :
8+ validate :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checkout
12+ uses : actions/checkout@v4
13+
14+ - name : Validate shell scripts
15+ run : |
16+ bash -n bootstrap.sh
17+ while IFS= read -r -d '' f; do
18+ bash -n "$f"
19+ done < <(find scripts -type f -name '*.sh' -print0)
20+
21+ - name : Validate compose config
22+ run : |
23+ cp .env.example .env
24+ docker compose --profile autoupdate config >/dev/null
25+ rm .env
Original file line number Diff line number Diff line change 22# Mac Media Stack - One-Shot Installer
33# Usage: curl -fsSL https://raw.githubusercontent.com/liamvibecodes/mac-media-stack/main/bootstrap.sh | bash
44
5- set -e
5+ set -euo pipefail
66
77RED=' \033[0;31m'
88GREEN=' \033[0;32m'
@@ -47,7 +47,12 @@ echo ""
4747INSTALL_DIR=" $HOME /mac-media-stack"
4848if [[ -d " $INSTALL_DIR " ]]; then
4949 echo -e " ${YELLOW} Note:${NC} $INSTALL_DIR already exists. Pulling latest..."
50- cd " $INSTALL_DIR " && git pull --ff-only 2> /dev/null || true
50+ if ! git -C " $INSTALL_DIR " pull --ff-only; then
51+ echo -e " ${RED} Failed to update existing repo at $INSTALL_DIR .${NC} "
52+ echo " Resolve local git issues, then re-run bootstrap."
53+ echo " Suggested check: cd $INSTALL_DIR && git status"
54+ exit 1
55+ fi
5156else
5257 echo -e " ${CYAN} Cloning repo...${NC} "
5358 git clone https://github.com/liamvibecodes/mac-media-stack.git " $INSTALL_DIR "
@@ -69,7 +74,8 @@ if grep -q "your_wireguard_private_key_here" .env 2>/dev/null; then
6974 echo " You need your ProtonVPN WireGuard credentials."
7075 echo " If someone gave you a private key and address, enter them now."
7176 echo " "
72- read -p " WireGuard Private Key: " vpn_key
77+ read -s -p " WireGuard Private Key: " vpn_key
78+ echo " "
7379 read -p " WireGuard Address (e.g. 10.2.0.2/32): " vpn_addr
7480
7581 if [[ -n " $vpn_key " && -n " $vpn_addr " ]]; then
Original file line number Diff line number Diff line change 11#! /bin/bash
22# Installs the auto-heal launchd job (runs hourly).
33
4- set -e
4+ set -euo pipefail
55
66GREEN=' \033[0;32m'
77NC=' \033[0m'
88
99SCRIPT_DIR=" $( cd " $( dirname " $0 " ) " && pwd) "
10+ LAUNCH_DIR=" $HOME /Library/LaunchAgents"
11+ LOG_DIR=" $HOME /Media/logs/launchd"
1012PLIST_NAME=" com.media-stack.auto-heal"
11- PLIST_PATH=" $HOME /Library/LaunchAgents/$PLIST_NAME .plist"
13+ PLIST_PATH=" $LAUNCH_DIR /$PLIST_NAME .plist"
14+
15+ mkdir -p " $LAUNCH_DIR " " $LOG_DIR "
1216
1317cat > " $PLIST_PATH " << EOF
1418<?xml version="1.0" encoding="UTF-8"?>
@@ -27,9 +31,9 @@ cat > "$PLIST_PATH" <<EOF
2731 <key>RunAtLoad</key>
2832 <true/>
2933 <key>StandardOutPath</key>
30- <string>/dev/null </string>
34+ <string>$LOG_DIR /auto-heal.out.log </string>
3135 <key>StandardErrorPath</key>
32- <string>/dev/null </string>
36+ <string>$LOG_DIR /auto-heal.err.log </string>
3337</dict>
3438</plist>
3539EOF
@@ -38,6 +42,6 @@ launchctl unload "$PLIST_PATH" 2>/dev/null || true
3842launchctl load " $PLIST_PATH "
3943
4044echo -e " ${GREEN} Auto-heal installed.${NC} Runs every hour + on login."
41- echo " Logs: ~/Media/logs/auto-heal.log"
45+ echo " Logs: ~/Media/logs/auto-heal.log and ~/Media/logs/launchd/ "
4246echo " "
4347echo " To uninstall: launchctl unload $PLIST_PATH && rm $PLIST_PATH "
You can’t perform that action at this time.
0 commit comments