summaryrefslogtreecommitdiff
path: root/volinit-netatalk
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2001-12-13 16:20:19 +0000
committerJonas Smedegaard <dr@jones.dk>2001-12-13 16:20:19 +0000
commit71f00e0988ca7f453968beedddfb528eb1d8e446 (patch)
tree228a6067bfd0b53d07c3ee96521f6245d0c2a83d /volinit-netatalk
parent131f0dfbb8c6ff3f8dab46bad55fb2a33886edd9 (diff)
Cleanup of volinit-netatalk:
+ Support uid's containing dots (use ":" instead of "." in chown commands). + Add description. + Remove old commented out lines.
Diffstat (limited to 'volinit-netatalk')
-rwxr-xr-xvolinit-netatalk26
1 files changed, 15 insertions, 11 deletions
diff --git a/volinit-netatalk b/volinit-netatalk
index cf995ac..f81bad8 100755
--- a/volinit-netatalk
+++ b/volinit-netatalk
@@ -1,11 +1,21 @@
#!/bin/bash
+# Reset access rights of a netatalk archive
+#
+# The archive should be in subfolders named after read/write and readonly groups
+# like this: /var/local/netatalk/files_administered_by_admins/admin/users/
+#
+# Also, the file /etc/local/volumes should contain something like the following
+# (indicating the root of all netatalk folders):
+#
+# NDIR="/var/local/netatalk"
+#
+
[ -f /etc/local/volumes ] || exit 1
. /etc/local/volumes
[ "x$NDIR" = "x" ] && exit 1
if [ $# -eq 0 ]; then
-# echo "$0: directory name(s) required"
echo "Usage: $0 <base directory> <read user/group> <write user/group> [create]"
exit 1
fi
@@ -28,13 +38,8 @@ if [ "x$3" = "x" ]; then
fi
GRP=$3
-#GRPUSER="nobody"
GRPUSER="admin"
-#if [ "x$4" != "x" ]; then
-# GRPUSER=$4
-#else
- id $GRP >/dev/null && GRPUSER=$GRP
-#fi
+id $GRP >/dev/null && GRPUSER=$GRP
if [ "x$4" != "x" ]; then
if [ "x$4" == "xcreate" ]; then
@@ -48,16 +53,15 @@ fi
test -d $VOL/$ALL/$GRP || exit
test -d $VOL/$ALL/$GRP/.AppleDouble || mkdir $VOL/$ALL/$GRP/.AppleDouble
test -d $VOL/$ALL/$GRP/.AppleDesktop || mkdir $VOL/$ALL/$GRP/.AppleDesktop
-#chown $ALLUSER.$ALL $VOL/$ALL
-chown root.$ALL $VOL/$ALL
-chown $GRPUSER.$ALL $VOL/$ALL/$GRP
+chown root:$ALL $VOL/$ALL
+chown $GRPUSER:$ALL $VOL/$ALL/$GRP
chmod u=rwX,g=rXs,o= $VOL/$ALL
chmod u=rwX,g=rXs,o= $VOL/$ALL/$GRP
echo "People in group $GRP has read/write access through AppleShare"
test $GRP = $ALL || echo "People in group $ALL has read access through AppleShare"
echo "Others have no access"
echo -n "Checking permissions..."
-chown -R .$GRP $VOL/$ALL/$GRP \
+chown -R :$GRP $VOL/$ALL/$GRP \
&& chmod -R u=rwX,g=rwXs,o=rX $VOL/$ALL/$GRP \
&& chmod u=rwX,g=rXs,o=rX $VOL/$ALL/$GRP
echo "."