summaryrefslogtreecommitdiff
path: root/localdeluser
diff options
context:
space:
mode:
Diffstat (limited to 'localdeluser')
-rwxr-xr-xlocaldeluser5
1 files changed, 4 insertions, 1 deletions
diff --git a/localdeluser b/localdeluser
index e6b6b6f..640d87b 100755
--- a/localdeluser
+++ b/localdeluser
@@ -11,4 +11,7 @@
# TODO: Only allow deleting regular users
#
-exec sudo /usr/sbin/adduser $1
+sudo=sudo
+[ "$(id -u)" -ne 0 ] || sudo=
+
+exec $sudo /usr/sbin/adduser $1