Add update.sh, persist Go on PATH via profile.d

update.sh pulls the latest main, rebuilds, reinstalls, and restarts
the service in one step. install.sh/bootstrap.sh now also drop
/etc/profile.d/go-path.sh so Go stays on PATH in future shells, not
just within the running install script.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
sysops
2026-07-10 17:59:04 +02:00
co-authored by Claude Sonnet 5
parent f333623035
commit b2b6b82f58
4 changed files with 99 additions and 0 deletions
+8
View File
@@ -3,6 +3,8 @@
# built at ./wireguard-ui-multi (run `go build ./cmd/wireguard-ui-multi` first).
set -euo pipefail
export PATH="/usr/local/go/bin:/usr/local/bin:$PATH"
BIN_SRC="./wireguard-ui-multi"
BIN_DST="/usr/local/bin/wireguard-ui-multi"
CONFIG_DIR="/etc/wireguard-ui-multi"
@@ -28,6 +30,12 @@ if [[ ! -f "$BIN_SRC" ]]; then
fi
fi
if [[ -d /usr/local/go/bin ]] && [[ ! -f /etc/profile.d/go-path.sh ]]; then
echo "Persisting Go on PATH for future shells (/etc/profile.d/go-path.sh)..."
echo 'export PATH="/usr/local/go/bin:$PATH"' > /etc/profile.d/go-path.sh
chmod 0644 /etc/profile.d/go-path.sh
fi
echo "Creating directories..."
mkdir -p /usr/local/bin
mkdir -p "$CONFIG_DIR"