summaryrefslogtreecommitdiff
path: root/adduser.local
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2010-10-24 15:32:59 +0200
committerJonas Smedegaard <dr@jones.dk>2010-10-24 15:32:59 +0200
commita0fe32ae0ec701890023ba34f6296aeea3a00dd7 (patch)
tree79e0bbe789c803e87601bed3f17b5177704fff52 /adduser.local
parentf6ac54747dc3ba12a3d72d160e60663ee7ad0606 (diff)
Treat usernames containing dash as auxiliary, and suppress human-user extensions then.
Diffstat (limited to 'adduser.local')
-rwxr-xr-xadduser.local21
1 files changed, 15 insertions, 6 deletions
diff --git a/adduser.local b/adduser.local
index a822a17..a526ab2 100755
--- a/adduser.local
+++ b/adduser.local
@@ -42,9 +42,18 @@ add2list() { /bin/echo "$1" | /usr/sbin/add_members -w y -a y -r - "$2"; }
[ -f /etc/local/users.conf ] && . /etc/local/users.conf
+# resolve account profiles
+case "$NEWUSERNAME" in
+ *-*)
+ profile_aux=1
+ ;;
+ *)
+ ;;
+esac
+
# Samba password
#FIXME: Check if enabled in samba.conf (or included files!)
-if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && ([ -x /usr/bin/pdbedit ] || [ -x /usr/bin/smbpasswd ]); then
+if [ -z "$profile_aux" ] && [ -n "$VERBOSE" ] && [ "$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
@@ -59,7 +68,7 @@ if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && ([ -x /usr/bin/pdbedit ] || [ -x
fi
# Mail forwarding
-if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && [ -x /usr/local/sbin/userforward ]; then
+if [ -z "$profile_aux" ] && [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && [ -x /usr/local/sbin/userforward ]; then
echo -n "Forward mail to an external account (y/N)? "
read mailforward
case $mailforward in
@@ -80,7 +89,7 @@ fi
# Mailing lists
maildomain="`maildomain`"
-if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && [ -n "$maildomain" ]; then
+if [ -z "$profile_aux" ] && [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && [ -n "$maildomain" ]; then
echo -n "Subscribe $NEWUSERNAME@$maildomain to mailinglists (y/N)? "
read subscribe
case $subscribe in
@@ -105,7 +114,7 @@ if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ] && [ -n "$maildomain" ]; then
esac
fi
-if [ -f /etc/local/users.conf ]; then
+if [ -z "$profile_aux" ] && [ -f /etc/local/users.conf ]; then
. /etc/local/users.conf
if [ -n "$USERS_GROUPNAME" ]; then
@@ -134,7 +143,7 @@ fi
#access to devices like CD-ROM, soundcard and modem needed)?
#
#+
-if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ]; then
+if [ -z "$profile_aux" ] && [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ]; then
echo -n "Grant this user access to local utilities (y/N)?"
read localuser
case $localuser in
@@ -148,6 +157,6 @@ if [ -n "$VERBOSE" ] && [ "$VERBOSE" -gt 0 ]; then
esac
fi
-if [ -x /usr/local/sbin/user-init ]; then
+if [ -z "$profile_aux" ] && [ -x /usr/local/sbin/user-init ]; then
/usr/local/sbin/user-init $NEWUSERNAME
fi