Skip to content

Commit 6f09e13

Browse files
andystimeclaude
andcommitted
Fix uninstall.sh to use root's config dir when unregistering
When running `sudo ggo agent unregister`, the command looks for config in the calling user's home directory, not root's. This causes it to report "Agent is not registered" even when the agent IS registered under root. Fix by explicitly passing --config-dir /root/.gpugo/config when needs_sudo is true, ensuring the unregister command finds the actual agent configuration. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent e308276 commit 6f09e13

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

scripts/uninstall.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,13 @@ unregister_from_server() {
300300
fi
301301

302302
# Run unregister command (don't suppress output so user can see what happened)
303+
# When using sudo, explicitly specify root's config dir since the command
304+
# defaults to the calling user's home directory, not root's
303305
local unregister_result=0
304306
if [ "${needs_sudo}" = "true" ]; then
305307
SUDO=$(get_sudo)
306308
if [ -n "${SUDO}" ]; then
307-
${SUDO} "${binary_path}" agent unregister --force || unregister_result=$?
309+
${SUDO} "${binary_path}" agent unregister --config-dir /root/.gpugo/config --force || unregister_result=$?
308310
else
309311
warn "Sudo not available, attempting unregister without sudo (may fail)"
310312
"${binary_path}" agent unregister --force || unregister_result=$?

0 commit comments

Comments
 (0)