1 |
#!/sbin/runscript |
2 |
# |
3 |
# DESCRIPTION |
4 |
# |
5 |
# Startup init script for BackupPC on Gentoo` linux. |
6 |
# |
7 |
# Distributed with BackupPC version 2.1.0, released 20 Jun 2004. |
8 |
# |
9 |
# description: Starts and stops the BackupPC server |
10 |
# Copy to /etc/init.d and run 'rc-update add backuppc default' |
11 |
|
12 |
# get our configuration options |
13 |
source /etc/conf.d/backuppc |
14 |
|
15 |
checkconfig() { |
16 |
if [ ! -f ${CONF_FILE} ] ; then |
17 |
eeror "No ${CONF_FILE} exists!" |
18 |
fi |
19 |
} |
20 |
|
21 |
start() { |
22 |
checkconfig || return 1 |
23 |
ebegin "Starting BackupPC" |
24 |
start-stop-daemon --start --chuid ${USER} --user ${USER} --pidfile ${PID_FILE} --exec ${EXEC} -- ${EXEC_OPTIONS} |
25 |
eend $? |
26 |
} |
27 |
|
28 |
stop() { |
29 |
ebegin "Stopping BackupPC" |
30 |
start-stop-daemon --stop --pidfile ${PID_FILE} --name BackupPC |
31 |
eend $? |
32 |
} |
33 |
|
34 |
restart() { |
35 |
ebegin "Restarting BackupPC" |
36 |
svc_stop |
37 |
svc_start |
38 |
eend $? "Failed to restart BackupPC" |
39 |
} |
40 |
|
41 |
status() { |
42 |
return |
43 |
eend $? |
44 |
} |
45 |
|