|
Lines 1-24
Link Here
|
| 1 |
#!/bin/sh |
1 |
#!/bin/sh |
| 2 |
# |
2 |
# |
| 3 |
# $FreeBSD$ |
3 |
# $FreeBSD$ |
| 4 |
# |
4 |
# |
| 5 |
|
5 |
|
| 6 |
# PROVIDE: anacron |
6 |
# PROVIDE: %%PORTNAME%% |
| 7 |
# REQUIRE: LOGIN |
7 |
# REQUIRE: LOGIN |
|
|
8 |
# KEYWORD: resume |
| 8 |
|
9 |
|
| 9 |
# |
10 |
# |
| 10 |
# Add the following line to /etc/rc.conf to enable anacron: |
11 |
# Execute one of the following commands as root to enable %%PORTNAME%%: |
| 11 |
# |
12 |
# |
| 12 |
# anacron_enable="YES" |
13 |
# service %%PORTNAME%% enable |
|
|
14 |
# sysrc %%PORTNAME%%_enable=YES |
| 13 |
# |
15 |
# |
| 14 |
|
16 |
|
| 15 |
. /etc/rc.subr |
17 |
. /etc/rc.subr |
| 16 |
|
18 |
|
| 17 |
name=anacron |
19 |
name=%%PORTNAME%% |
| 18 |
rcvar=anacron_enable |
20 |
command="%%PREFIX%%/sbin/%%PORTNAME%%" |
|
|
21 |
desc="%%COMMENT%%" |
| 22 |
extra_commands=resume |
| 23 |
rcvar=%%PORTNAME%%_enable |
| 24 |
required_vars=syslogd_enable |
| 19 |
|
25 |
|
| 20 |
load_rc_config $name |
26 |
load_rc_config $name |
| 21 |
: ${anacron_enable:=NO} |
27 |
: ${%%PORTNAME%%_enable:=NO} |
| 22 |
command="%%PREFIX%%/sbin/anacron" |
|
|
| 23 |
|
28 |
|
| 24 |
run_rc_command "$1" |
29 |
if [ $# -gt 0 -a $1 = "resume" ]; then |
|
|
30 |
arg=start |
| 31 |
if checkyesno $rcvar; then |
| 32 |
info "starting ${name} after resume" |
| 33 |
fi |
| 34 |
else |
| 35 |
arg=$1 |
| 36 |
fi |
| 37 |
debug "$name: \$1 = $1, arg = $arg" |
| 38 |
|
| 39 |
run_rc_command "$arg" |