mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-14 03:39:53 +03:00
31 lines
717 B
Bash
31 lines
717 B
Bash
#!/sbin/openrc-run
|
|
|
|
description="Small HTTP server"
|
|
extra_started_commands="reload"
|
|
start_stop_daemon_args="--quiet"
|
|
|
|
cfgfile=/etc/mini_httpd/$RC_SVCNAME.conf
|
|
pidfile=/run/mini_httpd/$RC_SVCNAME.pid
|
|
command=/usr/sbin/mini_httpd
|
|
required_files="$cfgfile"
|
|
|
|
depend() {
|
|
need net
|
|
after firewall
|
|
}
|
|
|
|
start_pre() {
|
|
ebegin
|
|
checkpath -d ${pidfile%/*}
|
|
local logfile=$(awk -F= '$1 == "logfile" { print $2 }' $cfgfile 2>/dev/null)
|
|
[ -n "$logfile" ] && checkpath -d ${logfile%/*}
|
|
command_args="-i $pidfile -C $cfgfile ${logfile:+-l $logfile} $command_args"
|
|
$command -V -C $cfgfile >/dev/null
|
|
eend $?
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading $RC_SVCNAME configuration"
|
|
start-stop-daemon --signal HUP --pidfile $pidfile
|
|
eend $?
|
|
}
|