Files
DawnsorrowandCursor e89943224d Add Eden Smash Ultimate VPS room deployment scripts.
Provides install/update systemd workflow for git-based deploys to Ubuntu VPS.

Co-authored-by: Cursor <[email protected]>
2026-06-20 22:47:19 -05:00

36 lines
804 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SERVICE_NAME="eden-room"
UPDATE_BINARY="${UPDATE_BINARY:-0}"
require_root() {
if [[ "${EUID}" -ne 0 ]]; then
echo "Run as root: sudo $0" >&2
exit 1
fi
}
main() {
require_root
echo "Pulling latest config from git..."
git -C "${REPO_DIR}" pull --ff-only
if [[ "${UPDATE_BINARY}" == "1" ]]; then
echo "Re-downloading eden-room binary..."
"${REPO_DIR}/scripts/install.sh" --binary-only
else
chown -R eden:eden "${REPO_DIR}"
chmod 700 "${REPO_DIR}/scripts/"*.sh
chmod 600 "${REPO_DIR}/.env" 2>/dev/null || true
fi
systemctl restart "${SERVICE_NAME}"
echo "Updated and restarted ${SERVICE_NAME}."
systemctl status "${SERVICE_NAME}" --no-pager
}
main "$@"