Added http support for evhtp (not only https)

This commit is contained in:
Olof hagsand 2020-06-29 14:41:08 +02:00
parent 7ad07e1915
commit 9c82e97072
9 changed files with 184 additions and 79 deletions

View file

@ -90,9 +90,6 @@ fi
# RESTCONF protocol, eg http or https
: ${RCPROTO:=http}
# RESTCONF error message (if not up)
: ${RCERROR:="HTTP/1.1 502 Bad Gateway"}
# www user (on linux typically www-data, freebsd www)
# @see wwwstartuser which can be dropped to this
: ${wwwuser:=www-data}
@ -234,8 +231,13 @@ wait_backend(){
# @see wait_restconf
start_restconf(){
# Start in background
echo "sudo -u $wwwstartuser -s $clixon_restconf $RCLOG -D $DBG $*"
sudo -u $wwwstartuser -s $clixon_restconf $RCLOG -D $DBG $* &
if [ $RCPROTO = https ]; then
EXTRA="-s"
else
EXTRA=
fi
echo "sudo -u $wwwstartuser -s $clixon_restconf $RCLOG -D $DBG $EXTRA $*"
sudo -u $wwwstartuser -s $clixon_restconf $RCLOG -D $DBG $EXTRA $* &
if [ $? -ne 0 ]; then
err
fi