Bug 7844 - plack intranet tooling for developers
[koha.git] / misc / plack / intranet-plack.sh
1 #!/bin/sh -xe
2
3 site=ffzg
4 test ! -z "$1" && site=$1
5 dir=`dirname $0`
6
7 export KOHA_CONF=/etc/koha/sites/$site/koha-conf.xml 
8 export INTRANETDIR="$( xmlstarlet sel -t -v 'yazgfs/config/intranetdir' $KOHA_CONF )"
9
10 if [ ! -e "$INTRANETDIR/C4" ] ; then
11         echo "intranetdir in $KOHA_CONF doesn't point to Koha git checkout"
12         exit 1
13 fi
14
15 # we are not wathcing all CGI scripts since that tends to use a lot of CPU time for plackup
16 opt="--reload -R $INTRANETDIR/C4"
17 sudo -E -u $site-koha plackup -I $INTRANETDIR $opt --port 5001 $dir/koha.psgi