core115: Add missing parameter to actually generate new certificates
[ipfire-2.x.git] / src / initscripts / system / apache
CommitLineData
23104841
MT
1#!/bin/sh
2# Begin $rc_base/init.d/apache
3
4# Based on sysklogd script from LFS-3.1 and earlier.
5# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
6
23104841
MT
7. /etc/sysconfig/rc
8. $rc_functions
9
10case "$1" in
11 start)
65998e0a
MT
12 if [ -f /etc/httpd/server.key -a -f /etc/httpd/server.crt -a -f /etc/httpd/server.csr ]; then
13 /usr/local/bin/httpscert read >/dev/null 2>&1
14 else
73794dad 15 boot_mesg "Generating HTTPS host certificate (may take a couple of minutes)..."
65998e0a 16 /usr/local/bin/httpscert new >/dev/null 2>&1
75474c3c 17 evaluate_retval
73794dad
MT
18
19 # Make sure that the key is written to disk.
20 sync
65998e0a 21 fi
75474c3c 22 boot_mesg "Starting Apache daemon..."
23104841
MT
23 /usr/sbin/apachectl -k start
24 evaluate_retval
25 ;;
26
27 stop)
28 boot_mesg "Stopping Apache daemon..."
29 /usr/sbin/apachectl -k stop
30 evaluate_retval
31 ;;
32
33 restart)
34 boot_mesg "Restarting Apache daemon..."
35 /usr/sbin/apachectl -k restart
36 evaluate_retval
37 ;;
256575b3
CS
38
39 reload)
40 boot_mesg "Reloading Apache daemon..."
41 /usr/sbin/apachectl -k graceful
42 evaluate_retval
43 ;;
23104841
MT
44
45 status)
46 statusproc /usr/sbin/httpd
47 ;;
48
49 *)
50 echo "Usage: $0 {start|stop|restart|status}"
51 exit 1
52 ;;
53esac
54
55# End $rc_base/init.d/apache