Modifications : etc/nginx/org/chatperche/www/server.conf.m4
[lhc/admin.git] / srv / ateliers / etc / nginx / org / chatperche / www / install
deleted file mode 120000 (symlink)
index 135b97d18b3bcc472c3501d1d8165ca3b4ead05c..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-.../lib/tool/admin/etc/nginx/$site/install
\ No newline at end of file
new file mode 100755 (executable)
index 0000000000000000000000000000000000000000..a39a8d971db973e1b46f4abe305e17bc0837202e
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh -eu
+# SYNTAX: $path
+# DESCRIPTION: install
+
+# ACTION: initialize from .../lib/tool/admin/
+       tool=$(readlink -e "${0%/install}"/...)/lib/tool/admin
+       . "$tool"/lib/install.sh
+# ACTION: initialize $sv from ./sys/$sv/
+       sv=${cmd##*/etc/}
+       sv=${sv%%/*}
+# ACTION: initialize $site from ./etc/$sv/$site/install
+       site=${cmd##*/"$sv"/}
+       site=${site%/install}
+# ACTION: install from ./etc/nginx/\$site/install
+       "$tool"/etc/nginx/\$site/install "$site"
+# TODO: invoke php install script /etc/php5/fpm/org/chatperche/www/install
+# ACTION: install from ./etc/nginx/org/chatperche/www
+       pool=$("$tool"/cat sys/php5/fpm/org/chatperche/www/user)
+       user=$("$tool"/cat sys/nginx/org/chatperche/www/user)
+       home=$("$tool"/cat sys/nginx/org/chatperche/www/home)
+       "$tool"/ssh-sudo adduser "$pool" "$user"
+       "$tool"/etc/mysql/user/install "$pool"
+       "$tool"/etc/mysql/database/install "$pool"
+       "$tool"/install etc/nginx/org/chatperche/www