diff --git a/install-pingfinder.sh b/install-pingfinder.sh index 68c8486..50d90f4 100644 --- a/install-pingfinder.sh +++ b/install-pingfinder.sh @@ -1,8 +1,14 @@ #!/bin/sh set -euo pipefail +if ! systemd-notify --booted; then + echo "Systemd is required" + exit 1 +fi + + if ! [ $(id -u) = 0 ]; then - echo "Run this as root!" + echo "Must be run as root" exit 1 fi @@ -13,4 +19,5 @@ cp etc/systemd/system/pingfinder.timer /etc/systemd/system/pingfinder.timer cp usr/local/bin/pingfinder.sh /usr/local/bin/pingfinder.sh chmod +x /usr/local/bin/pingfinder.sh +systemctl daemon-reload systemctl enable pingfinder.timer \ No newline at end of file