summaryrefslogtreecommitdiffstats
path: root/abs/core/runit-scripts/runitscripts/services/lighttpd/run
blob: 73c183f6668a894161af25250936f9d3bec7661a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
export TERM=linux
. /etc/rc.conf
. /etc/rc.d/functions
stat_runit "Starting lighttpd"

#---creating ssl cert
if [ ! -f /etc/lighttpd/linhes.pem ]
then
    . /etc/systemconfig
    /usr/bin/openssl  req -new -x509 -keyout /etc/lighttpd/linhes.pem -out /etc/lighttpd/linhes.pem -days 4390  -nodes  -subj "/C=/ST=/L=/O=LinHES/OU=LinHES Entertainment Server/CN=$hostname"
    if [ $? = 0 ]
    then
        echo "include \"/etc/lighttpd/ssl-inc.conf\"" > /etc/gen_light_conf.d/ssl-inc.conf
    else
        rm -f  /etc/lighttpd/linhes.pem
    fi
    /usr/LH/bin/gen_light_include.py
fi
#--end creating ssl cert

if [ ! -d /var/run/lighttpd ] ; then
   mkdir -p /var/run/lighttpd
   chown http /var/run/lighttpd
fi

# Using -angel to start lighttpd allows lighttpd to accept signals
exec /usr/bin/lighttpd-angel -D -f /etc/lighttpd/lighttpd.conf