Add setup.sh for one-command server install
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
98180a0f6b
commit
24c27194d4
1 changed files with 24 additions and 0 deletions
24
setup.sh
Executable file
24
setup.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
REPO_URL="https://github.com/SantosFC/chamado-health.git"
|
||||||
|
INSTALL_DIR="${HOME}/src/chamado-health"
|
||||||
|
CONFIG_FILE="${HOME}/.config/chamado-health"
|
||||||
|
|
||||||
|
if [[ -z "${HEALTHCHECK_URL:-}" ]]; then
|
||||||
|
read -rp "HEALTHCHECK_URL: " HEALTHCHECK_URL
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -d "${INSTALL_DIR}/.git" ]]; then
|
||||||
|
git -C "${INSTALL_DIR}" pull --ff-only
|
||||||
|
else
|
||||||
|
git clone "${REPO_URL}" "${INSTALL_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "HEALTHCHECK_URL=${HEALTHCHECK_URL}" > "${CONFIG_FILE}"
|
||||||
|
echo "Config saved to ${CONFIG_FILE}."
|
||||||
|
|
||||||
|
bash "${INSTALL_DIR}/install_systemd.sh"
|
||||||
|
|
||||||
|
loginctl enable-linger
|
||||||
|
echo "Linger enabled — timer runs even without active session."
|
||||||
Loading…
Reference in a new issue