From 598d5307bbe5cf20f45780cd8ef1fb40c9694fe9 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 21 Apr 2019 19:56:10 +0200 Subject: Add boilerplate. Quote variable to please shellcheck. --- localrmstaleaccounts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 +# +# 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" -- cgit v1.2.3