summaryrefslogtreecommitdiffstats
path: root/install-all
diff options
context:
space:
mode:
authorChristian Klinger2016-06-15 16:43:17 +0200
committerChristian Klinger2016-06-15 16:43:17 +0200
commit2b18d0d0c49c3a75bd221ab86b7315f7bae98008 (patch)
tree7d44e103224c1a79e8ccdd5d0313f76180847303 /install-all
parentsmall style changes (diff)
parent[sysconfignew] Move css from global file to module specific one (diff)
downloadslx-admin-2b18d0d0c49c3a75bd221ab86b7315f7bae98008.tar.gz
slx-admin-2b18d0d0c49c3a75bd221ab86b7315f7bae98008.tar.xz
slx-admin-2b18d0d0c49c3a75bd221ab86b7315f7bae98008.zip
Merge branch 'modularization' of git.openslx.org:openslx-ng/slx-admin into modularization
Conflicts: install/content.sql install/schema.sql
Diffstat (limited to 'install-all')
-rwxr-xr-xinstall-all53
1 files changed, 53 insertions, 0 deletions
diff --git a/install-all b/install-all
new file mode 100755
index 00000000..42f8e5e4
--- /dev/null
+++ b/install-all
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+FILE=$(mktemp)
+if [ -z "$FILE" ]; then
+ echo "Something's fishy: No temp file!"
+ exit 1
+fi
+
+trap "rm -f -- '$FILE'" EXIT SIGINT SIGTERM
+
+START=$(php install.php | grep -m1 '^MODULE=' | cut -d= -f2-)
+
+if [ -z "$START" ]; then
+ echo "Cannot install slxadmin - did you configure the DB access properly?"
+ exit 1
+fi
+
+echo "Started with $START"
+
+declare -A COUNTER
+
+COUNTER["$START"]=1
+
+NEXT=$START
+RETRY=0
+while true; do
+ php install.php "$NEXT" > "$FILE"
+ MODULE=$(grep -m1 '^MODULE=' "$FILE" | cut -d= -f2-)
+ if [ -z "$MODULE" ]; then
+ echo "Barfed after $NEXT - no module name found in next run"
+ exit 1
+ fi
+ echo "Next module was ${MODULE}..."
+ (( COUNTER["$MODULE"]++ ))
+ if [ ${COUNTER["$MODULE"]} -gt 3 ]; then
+ echo "Iterated too many times"
+ exit 1
+ fi
+ STATUS=$(grep -m1 '^STATUS=' "$FILE" | cut -d= -f2-)
+ echo "Result: $STATUS"
+ if [ -z "$STATUS" ] || [ "$STATUS" = "UPDATE_RETRY" ]; then
+ RETRY=1
+ fi
+ if [ "$MODULE" = "$START" ]; then
+ if [ "$RETRY" = "0" ]; then
+ break
+ fi
+ RETRY=0
+ fi
+ NEXT=$MODULE
+done
+echo "Done."
+