Support for sending status message to server via http post
[grml-unittests.git] / autoconfig / deploy.sh
1 #!/bin/zsh
2
3 . /etc/grml/autoconfig.functions
4
5 mkdir -p /tmp/tests
6
7 TESTS_SRC=$(getbootparam testsrc)
8 STATUS=$(getbootparam status)
9
10 if [ -n "$TESTS_SRC" ] ; then
11     cd /tmp/tests
12     wget -m -np -nd $TESTS_SRC/
13     cd -
14 fi
15 chmod +x /tmp/tests/*.sh
16
17 TESTS=""
18 for file in /tmp/tests/*.sh ; do
19     PATH=/tmp/tests $file > /tmp/output.log
20     RETVAL=$?
21     [ "$RETVAL" -ne 0 ] && wget --post-file=/tmp/output.log $STATUS/FAIL
22     TESTS="$TESTS $file"
23
24 done
25 wget --post-data="Run $TESTS" $STATUS/DONE
26