# HG changeset patch # User Christophe Lincoln # Date 1390515805 -3600 # Node ID 65ad158a371ba1cf7a5bcddffcb07c52cb7cf443 # Parent e9a2fa5a68d95dad1815bcebf9572295211cc87d Add a users list command diff -r e9a2fa5a68d9 -r 65ad158a371b slish --- a/slish Thu Jan 23 22:51:29 2014 +0100 +++ b/slish Thu Jan 23 23:23:25 2014 +0100 @@ -33,6 +33,8 @@ $(boldify "Commands:") info Display paths, configs and some stats + last Show last chroted users + users List all users with name and mail setup Setup SliSH server and user chroot gen-chroot Generate a new default or user chroot clean-chroot Clean the chroot but skip home and root @@ -203,7 +205,7 @@ newline echo "$(boldify 'Deleting user:') $(colorize 32 "$user")" separator - echo -n "Removing user account from: $(hostname) server" + echo -n "Removing user account from $(hostname) server" deluser "$user"; status sed -i "/^$user:/"d ${root}/etc/passwd sed -i "/^$user:/"d ${root}/etc/group @@ -280,6 +282,18 @@ separator tac ${activity} | head -n 20 separator && newline ;; + users) + check_root + newline + boldify "Users list" + separator + for user in $(ls ${people}) + do + . ${people}/${user}/account.conf + echo -n "$(colorize 34 "$user")" + echo -n "$(indent 20 "$NAME")" && indent 46 "<$MAIL>" + done + separator && newline ;; setup) check_root setup ;;