diff options
-rwxr-xr-x | localrmstaleaccounts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/localrmstaleaccounts b/localrmstaleaccounts index dbb92f0..c7ceaae 100755 --- a/localrmstaleaccounts +++ b/localrmstaleaccounts @@ -1,4 +1,10 @@ #!/bin/sh +# +# /usr/local/sbin/localrmstaleaccounts +# Copyright 2012, 2014, 2019 Jonas Smedegaard <dr@jones.dk> +# +# Remove unused user accounts +# set -e @@ -50,7 +56,7 @@ remove_account() { [ -n "$DRY_RUN" ] || localrmaccount "$1" } -for user in $@; do +for user in "$@"; do home=$(getent passwd "$user" | cut -d: -f6) if [ -z "$home" ]; then warn "Skipping user $user: failed resolving homedir" |