File: mini_httpd.sh

package info (click to toggle)
mini-httpd 1.30-0.2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 924 kB
  • sloc: ansic: 3,619; sh: 208; makefile: 102
file content (41 lines) | stat: -rwxr-xr-x 972 bytes parent folder | download | duplicates (2)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
#
# mini_httpd.sh - startup script for mini_httpd on FreeBSD
#
# This should be manually installed as:
#  /usr/local/etc/rc.d/mini_httpd
# It gets run at boot-time.
#
# Variables available:
#   mini_httpd_enable='YES'
#   mini_httpd_program='/usr/local/sbin/mini_httpd'
#   mini_httpd_pidfile='/var/run/mini_httpd.pid'
#   mini_httpd_devfs=...
#   mini_httpd_flags=...
#
# PROVIDE: mini_httpd
# REQUIRE: LOGIN FILESYSTEMS
# KEYWORD: shutdown

. /etc/rc.subr

name='mini_httpd'
rcvar='mini_httpd_enable'
start_precmd='mini_httpd_precmd'
mini_httpd_enable_defval='NO'

load_rc_config "$name"
command="${mini_httpd_program:-/usr/local/sbin/${name}}"
pidfile="${mini_httpd_pidfile:-/var/run/${name}.pid}"
command_args="-i ${pidfile}"

mini_httpd_precmd ()
{
	if [ -n "$mini_httpd_devfs" ] ; then
		mount -t devfs devfs "$mini_httpd_devfs"
		devfs -m "$mini_httpd_devfs" rule -s 1 applyset
		devfs -m "$mini_httpd_devfs" rule -s 2 applyset
	fi
}

run_rc_command "$1"