Added
Link Here
|
0 |
- |
1 |
#!/bin/sh |
|
|
2 |
|
3 |
# PROVIDE: spoofdpi |
4 |
# REQUIRE: LOGIN |
5 |
# KEYWORD: shutdown |
6 |
# |
7 |
# Add the following lines to /etc/rc.conf or /etc/rc.conf.local to |
8 |
# enable spoofdpi: |
9 |
# spoofdpi_args (str): Custom additional arguments to be passed |
10 |
# spoofdpi (default empty). |
11 |
# spoofdpi_user (str): User to run spoofdpi as. Default |
12 |
# to "%%USER%%" created by the port. |
13 |
# spoofdpi_log (path): Console log file (default /dev/null). |
14 |
|
15 |
. /etc/rc.subr |
16 |
|
17 |
case $0 in |
18 |
/etc/rc*) |
19 |
# during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown), |
20 |
# so get the name of the script from $_file |
21 |
name=$_file |
22 |
;; |
23 |
*) |
24 |
name=$0 |
25 |
;; |
26 |
esac |
27 |
|
28 |
name=${name##*/} |
29 |
rcvar="${name}_enable" |
30 |
|
31 |
load_rc_config "${name}" |
32 |
|
33 |
eval "${rcvar}=\${${rcvar}:-'NO'}" |
34 |
eval "_args=\${${name}_args:-''}" |
35 |
eval "_user=\${${name}_user:-'%%USER%%'}" |
36 |
eval "_log=\${${name}_log:-/dev/null}" |
37 |
|
38 |
pidfile="/var/run/${name}.pid" |
39 |
|
40 |
command="/usr/sbin/daemon" |
41 |
command_args="-P ${pidfile} -u ${_user} -f -H -o ${_log} -m 3 %%PREFIX%%/bin/spoofdpi -no-banner ${_args}" |
42 |
|
43 |
run_rc_command "$1" |
44 |
|