Ajout : etc/sv/fanout/ .
[lhc/ateliers.git] / etc / sv / fanout / local.sh
diff --git a/etc/sv/fanout/local.sh b/etc/sv/fanout/local.sh
new file mode 100644 (file)
index 0000000..a825a0a
--- /dev/null
@@ -0,0 +1,27 @@
+home=/home/fanout
+cd /
+
+"$tool"/local/adduser "$sv" \
+ --disabled-login \
+ --disabled-password \
+ --group \
+ --home "$home" \
+ --shell /bin/false \
+ --system
+
+sudo install -d -m 750 -o "$sv" -g "$sv" \
+ "$home"
+sudo install -d -m 750 -o sys -g sys \
+ "$home"/src
+sudo adduser sys "$sv"
+if sudo test -d "$home"/src/.git
+ then
+       sudo -u sys /bin/sh -c "cd $home/src && git pull -v"
+ else
+       sudo -u sys git clone https://github.com/travisghansen/fanout "$home"/src
+ fi
+
+sudo -u sys make -C "$home"/src
+sudo install -o 755 -o root -g root \
+    "$home"/src/fanout \
+ /usr/local/bin/fanout