diff --git a/README.md b/README.md index 33ffffa..1618c83 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ From a clone of this repository on the Raspberry Pi: ```bash cd rpi-temp-humid-monitor -sudo ./install.sh +./install.sh # show help +sudo ./install.sh --install ``` This will: @@ -39,13 +40,13 @@ thmonitor-single # one-off read (uses venv) Cron-based single-shot mode instead of the loop daemon: ```bash -sudo ./install.sh --cron +sudo ./install.sh --install --cron ``` Install without starting the service: ```bash -sudo ./install.sh --no-start +sudo ./install.sh --install --no-start ``` Uninstall: diff --git a/install.sh b/install.sh index ab0b87e..597889d 100755 --- a/install.sh +++ b/install.sh @@ -2,12 +2,6 @@ # # Install rpi-temp-humid-monitor as a system app with a Python venv. # -# Usage: -# sudo ./install.sh # systemd loop daemon (default) -# sudo ./install.sh --cron # cron single-shot mode instead -# sudo ./install.sh --no-start # install only, do not enable/start -# sudo ./install.sh --uninstall # remove installed app files -# set -euo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -25,6 +19,7 @@ LEGACY_DIR="/usr/local/bin/thMonitor" RUN_MODE="systemd" DO_START=1 +DO_INSTALL=0 DO_UNINSTALL=0 APT_PACKAGES=( @@ -46,11 +41,36 @@ PYTHON_MODULES=( ) usage() { - sed -n '3,10p' "$0" | sed 's/^# \?//' - echo - echo "Environment overrides:" - echo " INSTALL_ROOT Install directory (default: ${INSTALL_ROOT})" - echo " CONFIG_FILE Config file path (default: ${CONFIG_FILE})" + local cmd + cmd="$(basename "$0")" + cat <