summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xadduser.local20
1 files changed, 11 insertions, 9 deletions
diff --git a/adduser.local b/adduser.local
index 49e3ada..8ee0914 100755
--- a/adduser.local
+++ b/adduser.local
@@ -1,15 +1,16 @@
#!/bin/sh
#
# /usr/local/sbin/adduser.local
-# Copyright 2001-2002 Jonas Smedegaard <dr@jones.dk>
+# Copyright 2001-2006 Jonas Smedegaard <dr@jones.dk>
#
-# $Id: adduser.local,v 1.24 2006-01-12 23:38:45 jonas Exp $
+# $Id: adduser.local,v 1.25 2006-08-25 02:29:51 jonas Exp $
#
-# Common adduser additions for Spiff and Xenux networks
+# Adduser additions for Redpill networks
#
# TODO: Allow local overriding of using /etc/mailname
# TODO: Only ask additional questions if real user
# TODO: handle samba passwords in /var/lib/samba/passdb.tdb
+# TODO: Invent a way to flag for INTERACTIVE without abusing VERBOSE
#
set -e
@@ -34,7 +35,7 @@ add2list() { /bin/echo "$1" | /usr/sbin/add_members -w y -a y -r - "$2"; }
# Samba password
#FIXME: Check if enabled in samba.conf (or included files!)
-if [ -x /usr/bin/pdbedit ] || [ -x /usr/bin/smbpasswd ]; then
+if [ "$VERBOSE" -gt 0 ] && ([ -x /usr/bin/pdbedit ] || [ -x /usr/bin/smbpasswd ]); then
echo -n "Add samba access to the account (y/N)? "
read sambaaccount
case $sambaaccount in
@@ -49,7 +50,7 @@ if [ -x /usr/bin/pdbedit ] || [ -x /usr/bin/smbpasswd ]; then
fi
# Mail forwarding
-if [ -x /usr/local/sbin/userforward ]; then
+if [ "$VERBOSE" -gt 0 ] && [ -x /usr/local/sbin/userforward ]; then
echo -n "Forward mail to an external account (y/N)? "
read mailforward
case $mailforward in
@@ -70,7 +71,7 @@ fi
# Mailing lists
maildomain="`maildomain`"
-if [ -n "$maildomain" ]; then
+if [ "$VERBOSE" -gt 0 ] && [ -n "$maildomain" ]; then
echo -n "Subscribe $NEWUSERNAME@$maildomain to mailinglists (y/N)? "
read subscribe
case $subscribe in
@@ -102,7 +103,7 @@ if [ -f /etc/local/users.conf ]; then
addgroup $NEWUSERNAME $USERS_GROUPNAME
fi
- if [ -n "$REALUSERS_GROUPNAME" ]; then
+ if [ "$VERBOSE" -gt 0 ] && [ -n "$REALUSERS_GROUPNAME" ]; then
echo "This system has both dummy and real users:"
echo " Dummy users have read access to specific files."
echo " Real users have read/write access to personal files."
@@ -118,12 +119,13 @@ if [ -f /etc/local/users.conf ]; then
fi
fi
-#if [ -n "$REALUSERS_GROUPNAME" ]; then
+#if [ "$VERBOSE" -gt 0 ] && [ -n "$REALUSERS_GROUPNAME" ]; then
# cat <<+
#Is this a remote or local user (with need for physical
#access to devices like CD-ROM, soundcard and modem needed)?
#
#+
+if [ "$VERBOSE" -gt 0 ]; then
echo -n "Grant this user access to local utilities (y/N)?"
read localuser
case $localuser in
@@ -135,7 +137,7 @@ fi
*)
;;
esac
-#fi
+fi
if [ -x /usr/local/sbin/user-init ]; then
/usr/local/sbin/user-init $NEWUSERNAME