init zfs slice
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 10 Oct 2011 20:27:20 +0000 (22:27 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 10 Oct 2011 20:27:20 +0000 (22:27 +0200)
bin/init-slice.sh [new file with mode: 0755]

diff --git a/bin/init-slice.sh b/bin/init-slice.sh
new file mode 100755 (executable)
index 0000000..a0be545
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh -xe
+
+. ./env.sh
+
+ZSLICE=`echo $SLICE | sed "s!^/!!"`
+
+group=`basename $SLICE`
+grep "^$group:" /var/lib/extrausers/group || echo "$group:$SLICE:$PORT:" >> /var/lib/extrausers/group
+
+grep "^md5:" /var/lib/extrausers/passwd || echo "md5::2000:$PORT:md5@example.com:$SLICE/md5:/bin/false" >> /var/lib/extrausers/passwd
+
+
+zfs create $ZSLICE
+mkdir $SLICE/md5
+chown md5:$group $SLICE/md5
+