From 7802f291cacd15c3c62617959129025e71bc3c0c Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 15 Apr 2004 21:42:06 +0000 Subject: quote strings, and add a few comments. --- user-init | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'user-init') diff --git a/user-init b/user-init index 076b2f9..5582200 100755 --- a/user-init +++ b/user-init @@ -5,9 +5,11 @@ set -e # reset flags apache_reload_needed="" runmode="normal" -mac="mac" -pc="pc" -xchange="xchange" + +# subfolder name defaults (edit /etc/local/users.conf to override) +mac="mac" # Optimized for sharing through AppleShare (netatalk) +pc="pc" # Optimized for sharing though SMB/CIFS (Samba) +xchange="xchange" # Readable by group if [ -e /etc/adduser.conf ]; then . /etc/adduser.conf @@ -16,18 +18,14 @@ else exit 1 fi -[ -f /etc/local/users.conf ] && . /etc/local/users.conf +[ -r /etc/local/users.conf ] && . /etc/local/users.conf -if [ -e /etc/local/volumes ]; then - . /etc/local/volumes -else - # exit silently if this system lacks required hints - exit 0 -fi +# exit silently if this system lacks required hints +[ -r /etc/local/volumes ] && . /etc/local/volumes || exit 0 XDIRREAL="$XDIR/users/root" -if [ $XCHANGE ]; then +if [ -n "$XCHANGE" ]; then if [ ! -d "$XDIR" ]; then echo "XDIR doesn't exist. Ignoring XCHANGE!" XCHANGE="" @@ -42,9 +40,9 @@ else exit 1 fi -[ $NETATALK_HOME ] && mac=$NETATALK_HOME -[ $SAMBA_HOME ] && pc=$SAMBA_HOME -[ $XCHANGE_HOME ] && xchange=$XCHANGE_HOME +[ -n "$NETATALK_HOME" ] && mac="$NETATALK_HOME" +[ -n "$SAMBA_HOME" ] && pc="$SAMBA_HOME" +[ -n "$XCHANGE_HOME" ] && xchange="$XCHANGE_HOME" echo "Setting up additional folders and permissions..." for user in $USERS; do -- cgit v1.2.3