blob: 5e00b709ff63f096d24ade26cc56dc437c9e89ba (
plain) (
blame)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
#!/bin/sh
# $FreeBSD$
#
# Shell in a Box Daemon startup script
#
# PROVIDE: shellinaboxd
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following to /etc/rc.conf[.local] to enable this service
#
# shellinaboxd_enable="YES"
#
# You can fine tune others variables too:
# shellinaboxd_fib="NONE"
# shellinaboxd_pidfile="/var/run/shellinabox.pid"
# shellinaboxd_user="%%USERS%%"
# shellinaboxd_group="%%GROUPS%%"
# shellinaboxd_port="4200"
# shellinaboxd_certdir="%%ETCDIR%%"
# shellinaboxd_certfile=
# Example: shellinaboxd_certfile="/your/cert.pem"
# shellinaboxd_flags=
shellinaboxd_setfib() {
sysctl net.fibs >/dev/null 2>&1 || return 0
case "$shellinaboxd_fib" in
[Nn][Oo][Nn][Ee])
;;
*)
command="setfib -F ${shellinaboxd_fib} ${command}"
;;
esac
}
. /etc/rc.subr
name="shellinaboxd"
rcvar=`set_rcvar`
command="%%PREFIX%%/bin/${name}"
start_precmd="shellinaboxd_setfib"
load_rc_config $name
shellinaboxd_enable=${shellinaboxd_enable:-"NO"}
shellinaboxd_fib=${shellinaboxd_fib:-"NONE"}
shellinaboxd_user=${shellinaboxd_user:-"%%USERS%%"}
shellinaboxd_group=${shellinaboxd_group:-"%%GROUPS%%"}
shellinaboxd_port=${shellinaboxd_port:-"4200"}
shellinaboxd_certdir=${shellinaboxd_certdir:-"%%ETCDIR%%"}
pidfile=${shellinaboxd_pidfile:-"/var/run/shellinaboxd.pid"}
command_args="--user=${shellinaboxd_user} --group=${shellinaboxd_group} --port=${shellinaboxd_port} --background=${pidfile}"
if [ "${shellinaboxd_certfile}" = "" ]; then
required_dirs="${shellinaboxd_certdir}"
command_args="$command_args --cert=${shellinaboxd_certdir}"
else
command_args="$command_args --cert-fd=3 3< ${shellinaboxd_certfile}"
fi
run_rc_command "$1"
|