diff options
Diffstat (limited to 'www-servers/webfs/files/webfs.initd')
-rw-r--r-- | www-servers/webfs/files/webfs.initd | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/www-servers/webfs/files/webfs.initd b/www-servers/webfs/files/webfs.initd new file mode 100644 index 000000000000..ec328b662f83 --- /dev/null +++ b/www-servers/webfs/files/webfs.initd @@ -0,0 +1,29 @@ +#!/sbin/openrc-run +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net +} + +start() { + WEBFS_OPTS="-p ${WEBFS_PORT:-80} -f ${WEBFS_INDEX:-index.html} ${WEBFS_OPTS}" + [ -n "${WEBFS_DOCROOT}" ] && WEBFS_OPTS="${WEBFS_OPTS} -r ${WEBFS_DOCROOT}" + [ -n "${WEBFS_CHROOT}" ] && WEBFS_OPTS="${WEBFS_OPTS} -R ${WEBFS_CHROOT}" + [ -n "${WEBFS_LOG}" ] && WEBFS_OPTS="${WEBFS_OPTS} -L ${WEBFS_LOG}" + [ -n "${WEBFS_MAXCONN}" ] && WEBFS_OPTS="${WEBFS_OPTS} -c ${WEBFS_MAXCONN}" + [ -n "${WEBFS_IPV6}" ] && WEBFS_OPTS="${WEBFS_OPTS} -6" + [ -n "${WEBFS_SSL}" ] && WEBFS_OPTS="${WEBFS_OPTS} -S" + [ -n "${WEBFS_SERVNAME}" ] && WEBFS_OPTS="${WEBFS_OPTS} -n ${WEBFS_SERVNAME}" + [ -n "${WEBFS_DIR_LIST}" ] || WEBFS_OPTS="${WEBFS_OPTS} -j" + + ebegin "Starting webfsd" + start-stop-daemon --start --quiet --exec /usr/bin/webfsd -- ${WEBFS_OPTS} + eend $? "Failed to start webfsd" +} + +stop() { + ebegin "Stopping webfsd" + start-stop-daemon --stop --quiet --exec /usr/bin/webfsd + eend $? "Failed to stop webfsd" +} |