summaryrefslogtreecommitdiff
path: root/target/device/valka/target_skeleton/etc/rc.d/crond
blob: ef1b7fee02f6177e2d396d77a69224063d7d87a2 (plain)
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
#!/bin/ash
. /etc/rc.subr

start() {
	echo -n " * Starting crond: "
	if [ ! -x ${crond_program} ]; then
		log_error "Missing 'crond' program (${crond_program})"
		echo "Failed"
		return 1
	fi

	${crond_program} -f -c ${crond_dir} ${crond_flags} &
	pid=$!
	if [ "$?" -eq 0 ]; then
		echo "${pid}" > ${crond_pidfile}
		echo "Ok"
	else
		echo "Failed"
	fi
}

stop() {
	echo " * Stopping crond..."
	killpid ${crond_pidfile}
}

rc_run_command "$1" "crond"