Scripts to bootstrap a development domtool environment
[hcoop/domtool2.git] / bootstrap / domtool-init-acl
diff --git a/bootstrap/domtool-init-acl b/bootstrap/domtool-init-acl
new file mode 100755 (executable)
index 0000000..3759fa4
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+SHAREDROOT=`../bin/domtool-config -path shared-root`
+DOMTOOLROOT="$1"
+
+if [ -z "$SHAREDROOT" ]; then
+    echo "shared-root not set, domtool not built?"
+    exit 1
+fi
+
+if [ -z "$DOMTOOLROOT" ]; then
+    echo "Usage: $0 USER"
+    exit 1
+fi
+
+if [ -f $SHAREDROOT/acl ]; then
+    echo "acl file already exists. Refusing to overwrite"
+    exit 1
+fi
+
+cat > $SHAREDROOT/acl <<EOF
+$USER
+priv all
+
+EOF