Update sourcezap-{setup,teardown}

This commit is contained in:
0x1eef 2024-08-18 20:00:37 -03:00
parent 2c13017d7b
commit d2f900f440
2 changed files with 5 additions and 4 deletions

View file

@ -16,6 +16,7 @@ libexec="${localbase}"/libexec/sourcezap
if [ "$(id -u)" = "0" ]; then
"${libexec}"/setup/setup-user
"${libexec}"/setup/setup-doas
printok "setup complete"
else
printerr "you must be root"
exit 1

View file

@ -15,10 +15,10 @@ user=_sourcezap
##
# main
if [ "$(id -u)" = "0" ]; then
pw userdel -n "${user}" || true
pw groupdel -n "${user}" || true
rm -rf /home/"${user:?}"/ || true
printok "done"
pw userdel -n "${user}" > /dev/null 2>&1 || true
pw groupdel -n "${user}" > /dev/null 2>&1 || true
rm -rf /home/"${user:?}"/ > /dev/null 2>&1 || true
printok "teardown complete"
else
printerr "you must be root"
exit 1