summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--satellit_installer/includes/10-handle_users.inc7
1 files changed, 3 insertions, 4 deletions
diff --git a/satellit_installer/includes/10-handle_users.inc b/satellit_installer/includes/10-handle_users.inc
index d0dab50..9063a40 100644
--- a/satellit_installer/includes/10-handle_users.inc
+++ b/satellit_installer/includes/10-handle_users.inc
@@ -26,15 +26,14 @@ add_user_nohome() {
}
kill_user() {
- echo -n "# Terminating user account id $1, leaving user home/files as they were: "
- userdel $(getent passwd "$1" | cut -f 1 -d ":") || perror "# could not kill userid ${1}!"
- echo " ok."
+ echo "# Terminating user account id $1"
+ userdel -r -f $( < /etc/passwd awk -F: '$3 == 1000 {print $1}' ) || perror "# could not kill userid ${1}!"
}
check_users() {
echo "#"
echo "# Checking for users to kill with id>=1000: "
- for userid in $(cat /etc/passwd|cut -f 3 -d ":"|sort -n); do
+ for userid in $( < /etc/passwd cut -f 3 -d ":" | sort -n ); do
case $userid in
65534) echo "# Ignoring user 65534/sync." ;;
*) [ "$userid" -ge 1000 ] && kill_user "$userid"