blob: 6f63103976b887c202e9ab488109ff9fc97271b4 (
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
|
#!/bin/sh
#
# swapmon - add / remove swap as needed
#
# PROVIDE: swapmon
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable swapmon:
#
#swapmon_enable="YES"
#
. /etc/rc.subr
name=swapmon
rcvar=swapmon_enable
command="%%PREFIX%%/sbin/${name}"
command_interpreter="/bin/sh"
CONFIG=%%PREFIX%%/etc/${name}rc
if [ -r "${CONFIG}" ]
then . "${CONFIG}"
fi
pidfile=${PIDFILE:-"/var/run/${name}.pid"}
swapmon_enable=${swapmon_enable:-"NO"}
load_rc_config ${name}
start_precmd='command_args="-F <&- 2>&1 >/dev/null &"'
stop_postcmd='rm $pidfile'
run_rc_command "$1"
|