Update portzap-{setup,teardown}
This commit is contained in:
parent
1b1ee6606d
commit
741f85cfc2
2 changed files with 5 additions and 4 deletions
|
@ -16,6 +16,7 @@ libexec="${localbase}"/libexec/portzap
|
||||||
if [ "$(id -u)" = "0" ]; then
|
if [ "$(id -u)" = "0" ]; then
|
||||||
"${libexec}"/setup/setup-user
|
"${libexec}"/setup/setup-user
|
||||||
"${libexec}"/setup/setup-doas
|
"${libexec}"/setup/setup-doas
|
||||||
|
printok "setup complete"
|
||||||
else
|
else
|
||||||
printerr "you must be root"
|
printerr "you must be root"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -15,10 +15,10 @@ user=_portzap
|
||||||
##
|
##
|
||||||
# main
|
# main
|
||||||
if [ "$(id -u)" = "0" ]; then
|
if [ "$(id -u)" = "0" ]; then
|
||||||
pw userdel -n "${user}" || true
|
pw userdel -n "${user}" > /dev/null 2>&1 || true
|
||||||
pw groupdel -n "${user}" || true
|
pw groupdel -n "${user}" > /dev/null 2>&1 || true
|
||||||
rm -rf /home/"${user:?}"/ || true
|
rm -rf /home/"${user:?}"/ > /dev/null 2>&1 || true
|
||||||
printok "done"
|
printok "teardown complete"
|
||||||
else
|
else
|
||||||
printerr "you must be root"
|
printerr "you must be root"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue