diff options
author | Jonas Smedegaard <dr@jones.dk> | 2002-02-24 01:21:58 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2002-02-24 01:21:58 +0000 |
commit | 7133dd4463eb4b65b6b87bf11010e583a4267d65 (patch) | |
tree | 446b05cde3bc713774325451074474773599400e /deluser.local | |
parent | 68078b6d22c69c448a6f035fc709181d11d93101 (diff) |
A few more tweaks and corrections to adduser.local, deluser.local and user-init.
Diffstat (limited to 'deluser.local')
-rwxr-xr-x | deluser.local | 27 |
1 files changed, 24 insertions, 3 deletions
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 |