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 /adduser.local | |
parent | 68078b6d22c69c448a6f035fc709181d11d93101 (diff) |
A few more tweaks and corrections to adduser.local, deluser.local and user-init.
Diffstat (limited to 'adduser.local')
-rwxr-xr-x | adduser.local | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/adduser.local b/adduser.local index 6c8dfbb..e946bf5 100755 --- a/adduser.local +++ b/adduser.local @@ -24,14 +24,22 @@ if [ -x /usr/local/sbin/smbadduser -a -f /etc/samba/smbpasswd -a -x /bin/csh ]; fi # Mail forwarding -#FIXME: Do some syntax checking and bail out with a warning if something wrong if [ -x /usr/local/sbin/userforward ]; then - echo -n "Forward mail to which account (leave blank to ignore)? " - read -s mailforward - echo + echo -n "Forward mail to an external account (y/N)? " + read mailforward case $mailforward in y|Y) - /usr/local/sbin/userforward $1 $mailforward + echo -n "Enter external email address: " + read mail_address + case $mail_address in + ?*@?*.*) + /usr/local/sbin/userforward $1 $mailforward + ;; + ?*) + echo "That wasn't a proper email address - skipping..." + ;; + esac + ;; esac fi @@ -43,12 +51,11 @@ lists="" for list in $lists; do if [ -d $listdir/$list -a -x /usr/sbin/add_members ]; then echo -n "Subscribe to mailinglist $list (y/N)? " - read -s subscribe - echo + read subscribe case $subscribe in y|Y) /bin/echo $NEWUSERNAME@`/bin/dnsdomainname` \ - | /usr/sbin/add_members -n - users + | /usr/sbin/add_members -n - users ;; esac fi @@ -56,11 +63,11 @@ done #FIXME: Make this ALOT more generic (or move it to /etc/local/adduser.d)! if [ -d /home/christof/ftp_christof_ro ]; then - echo "Real users have read/write access to personal files." - echo "Dummy users have read access to published files." + echo "This seems to be a dummy/real user environment:" + echo " Real users have read/write access to personal files." + echo " Dummy users have read access to published files." echo -n "Is this a *real* user (y/N)? " - read -s realuser - echo + read realuser case $realuser in y|Y) addgroup $NEWUSERNAME realusers @@ -70,7 +77,17 @@ if [ -d /home/christof/ftp_christof_ro ]; then || mkdir /home/christof/ftp_christof_ro/$1 chown christof: /home/christof/ftp_christof_ro/$1 chmod u=rw,go=r,a+X /home/christof/ftp_christof_ro/$1 - ln -s /home/christof/ftp_christof_ro/$1 $4/images + if [ -e $4/images ]; then + if [ -L $4/images ]; then + rm -rf $4/images + ln -s /home/christof/ftp_christof_ro/$1 $4/images + else + echo "Something is wrong - $4/images exists already." + echo "This maybe isn't a dummy/real environment after all. Bailing out..." + fi + else + ln -s /home/christof/ftp_christof_ro/$1 $4/images + fi ;; esac fi |