diff options
author | Jonas Smedegaard <dr@jones.dk> | 2002-02-24 00:11:07 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2002-02-24 00:11:07 +0000 |
commit | 98ba1338688b32ebca53f1e8f3d9691c808d14e1 (patch) | |
tree | 5db88052c46304281922ccfc4ff8be94f0b3cb10 /adduser.local | |
parent | 36e3b7b01bca68c463644cb95ec7f7ddea4d90df (diff) |
adduser.local and deluser.local: Improve support for mailinglists and samba passwords, and add (non-generic) support for environments with dummy/real users.
Diffstat (limited to 'adduser.local')
-rwxr-xr-x | adduser.local | 67 |
1 files changed, 55 insertions, 12 deletions
diff --git a/adduser.local b/adduser.local index d6bbbce..6c8dfbb 100755 --- a/adduser.local +++ b/adduser.local @@ -15,19 +15,62 @@ addgroup $NEWUSERNAME users if [ -x /usr/local/sbin/user-init ]; then /usr/local/sbin/user-init $NEWUSERNAME - fi +fi -test -e /etc/samba/smbpasswd && \ - /usr/local/sbin/smbadduser $NEWUSERNAME:$NEWUSERNAME \ - || true +# Samba password +#FIXME: Check if enabled in samba.conf (or included files!) +if [ -x /usr/local/sbin/smbadduser -a -f /etc/samba/smbpasswd -a -x /bin/csh ]; then + /usr/local/sbin/smbadduser $NEWUSERNAME:$NEWUSERNAME +fi -test -x /usr/sbin/add_members || exit 0 +# 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 + case $mailforward in + y|Y) + /usr/local/sbin/userforward $1 $mailforward + esac +fi -if [ -x /var/lib/mailman/lists/users ]; then - /bin/echo $NEWUSERNAME@`/bin/dnsdomainname` \ - | /usr/sbin/add_members -n - users +# Mailing lists +listdir="/var/lib/mailman/lists" +lists="" +[ -d $listdir ] && \ + lists=`find $listdir -type d -mindepth 1 -maxdepth 1 -exec basename '{}' \;` +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 + case $subscribe in + y|Y) + /bin/echo $NEWUSERNAME@`/bin/dnsdomainname` \ + | /usr/sbin/add_members -n - users + ;; + esac fi -#if [ -x /var/lib/mailman/lists/friends ]; then -# /bin/echo $NEWUSERNAME@`/bin/dnsdomainname` \ -# | /usr/sbin/add_members -n - friends -# fi +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 -n "Is this a *real* user (y/N)? " + read -s realuser + echo + case $realuser in + y|Y) + addgroup $NEWUSERNAME realusers + ;; + *) + [ -e /home/christof/ftp_christof_ro/$1 ] \ + || 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 + ;; + esac +fi |