From 7133dd4463eb4b65b6b87bf11010e583a4267d65 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 24 Feb 2002 01:21:58 +0000 Subject: A few more tweaks and corrections to adduser.local, deluser.local and user-init. --- deluser.local | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'deluser.local') diff --git a/deluser.local b/deluser.local index e8c04d8..796c12a 100755 --- a/deluser.local +++ b/deluser.local @@ -5,7 +5,17 @@ OLDUID=$2 OLDGID=$3 OLDHOMEDIR=$4 -[ "x$OLDHOMEDIR" = "x/home/$OLDUSERNAME" ] || exit 0 +if [ ! -d "$OLDHOMEDIR" ]; then + echo -n "Something's wrong - home directory doesn't exist. Continue (y/N)? " + read continue + case $continue in + y|Y) + ;; + *) + exit 1 + ;; + esac +fi if [ -e /etc/samba/smbpasswd -a -x /usr/bin/smbpasswd ]; then /usr/bin/smbpasswd -x $OLDUSERNAME || true @@ -25,11 +35,22 @@ fi #FIXME: Make this ALOT more generic! if [ -d /home/christof/ftp_christof_ro/$1 -a -n "$1" ]; then echo -n "It seems this was a dummy user. Remove shared files (y/N)? " - read -s remove_files - echo + read remove_files case $remove_files in y|Y) rm -rf /home/christof/ftp_christof_ro/$1 ;; esac fi + +# It seems deluser doesn't always remove home even if told to do so +#FIXME: Only ask if removing is enabling in /etc/deluser.conf +if [ -d $4 -a -n "$4" ]; then + echo -n "Remove old home (y/N)? " + read remove_home + case $remove_home in + y|Y) + rm -rf $4 + ;; + esac +fi -- cgit v1.2.3