summaryrefslogtreecommitdiff
path: root/user-init
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2004-04-15 21:42:06 +0000
committerJonas Smedegaard <dr@jones.dk>2004-04-15 21:42:06 +0000
commit7802f291cacd15c3c62617959129025e71bc3c0c (patch)
tree72f44bfffebb261f948f879cdde316b680f5d48d /user-init
parentbdbf12dd61d4bb0d5f97004ed949413cd6fb3356 (diff)
quote strings, and add a few comments.
Diffstat (limited to 'user-init')
-rwxr-xr-xuser-init26
1 files changed, 12 insertions, 14 deletions
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