Skip to content

uninstall-idle.sh: removes scripts from /home/<user>, but install uses the getent home #131

Open

Description

@royosherove

uninstall-idle.sh L78-81:

for u in ec2-user ubuntu "${SUDO_USER:-}" "$(id -un)"; do
  [[ -z "$u" ]] && continue
  try "rm -f /home/${u}/.openclaw/workspace/idle-check.sh /home/${u}/.openclaw/workspace/idle-check.py"
done
ok "scripts removed"

Problem: install-idle.sh L94 gets the home directory from getent passwd, and its comment says "NOT hardcoded /home" (root uses /root). With --install-user root, the scripts go to /root/.openclaw/workspace/, but the uninstaller tries /home/root/.... The files stay on disk, and the script still prints "scripts removed".

Fix: In the loop, get the home with h="$(getent passwd "$u" | cut -d: -f6)"; [[ -n "$h" ]] || continue, then remove "$h/.openclaw/workspace/idle-check.sh" and "$h/.openclaw/workspace/idle-check.py".


Found by a code read at commit 1e50295. The code was read, but not run on a real instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions