Fix agent install/uninstall sudo placement, add dependency install hints
curl ... | API_URL=... bash runs as the invoking user, not root, so "sudo" has to go right after the pipe (elevating bash) rather than before curl — the old commands in the app UI, README, and scripts' own usage comments put it in a spot that still failed the root check. Also have install.sh/report-tasks.sh suggest the right package-manager command (apt/dnf/yum/apk/pacman/zypper) when curl or jq is missing instead of just failing, and bring the README up to date with both.
This commit is contained in:
1 parent
0615866311
commit
329dcab936
5 files changed
+71
-18
No files matched your search
@@ -2,8 +2,9 @@
|
||||
# Removes the Schedule Task Manager agent from this server: stops and deletes
|
||||
# its systemd timer/service, the installed script, and its credentials file.
|
||||
#
|
||||
# Usage:
|
||||
# curl -fsSL https://schedule.example.lan/agent/linux/uninstall.sh | bash
|
||||
# Usage (must run as root — if not already root, put sudo right after the
|
||||
# pipe so it applies to bash, not to curl):
|
||||
# curl -fsSL https://schedule.example.lan/agent/linux/uninstall.sh | sudo bash
|
||||
#
|
||||
set -euo pipefail
|
||||
|
||||
@@ -13,6 +14,8 @@ SYSTEMD_DIR="/etc/systemd/system"
|
||||
|
||||
if [[ "$EUID" -ne 0 ]]; then
|
||||
echo "This uninstaller must be run as root." >&2
|
||||
echo "If you're piping from curl, put sudo right after the pipe so it elevates bash, not curl:" >&2
|
||||
echo " curl -fsSL ... | sudo bash" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in new issue
Block a user