Add HEALTHCHECK_INTERVAL support to setup.sh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fa059fd060
commit
e4e1756fa7
1 changed files with 6 additions and 0 deletions
6
setup.sh
6
setup.sh
|
|
@ -4,6 +4,7 @@ set -euo pipefail
|
||||||
REPO_URL="https://github.com/SantosFC/chamado-health.git"
|
REPO_URL="https://github.com/SantosFC/chamado-health.git"
|
||||||
INSTALL_DIR="${HOME}/src/chamado-health"
|
INSTALL_DIR="${HOME}/src/chamado-health"
|
||||||
CONFIG_FILE="${HOME}/.config/chamado-health"
|
CONFIG_FILE="${HOME}/.config/chamado-health"
|
||||||
|
INTERVAL="${HEALTHCHECK_INTERVAL:-1min}"
|
||||||
|
|
||||||
if [[ -z "${HEALTHCHECK_URL:-}" ]]; then
|
if [[ -z "${HEALTHCHECK_URL:-}" ]]; then
|
||||||
read -rp "HEALTHCHECK_URL: " HEALTHCHECK_URL </dev/tty
|
read -rp "HEALTHCHECK_URL: " HEALTHCHECK_URL </dev/tty
|
||||||
|
|
@ -18,6 +19,11 @@ fi
|
||||||
echo "HEALTHCHECK_URL=${HEALTHCHECK_URL}" > "${CONFIG_FILE}"
|
echo "HEALTHCHECK_URL=${HEALTHCHECK_URL}" > "${CONFIG_FILE}"
|
||||||
echo "Config saved to ${CONFIG_FILE}."
|
echo "Config saved to ${CONFIG_FILE}."
|
||||||
|
|
||||||
|
sed -i "s/OnUnitActiveSec=.*/OnUnitActiveSec=${INTERVAL}/" \
|
||||||
|
"${INSTALL_DIR}/systemd/chamado-health.timer"
|
||||||
|
sed -i "s/OnBootSec=.*/OnBootSec=${INTERVAL}/" \
|
||||||
|
"${INSTALL_DIR}/systemd/chamado-health.timer"
|
||||||
|
|
||||||
bash "${INSTALL_DIR}/install_systemd.sh"
|
bash "${INSTALL_DIR}/install_systemd.sh"
|
||||||
|
|
||||||
loginctl enable-linger
|
loginctl enable-linger
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue