X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=init.d%2Fsrc%2Fgentoo-backuppc;fp=init.d%2Fsrc%2Fgentoo-backuppc;h=e214941de35cb1480362a33decf24734b7da5ef4;hb=7dee89bfce659051d486cc66515bb7f22bbc4f09;hp=0000000000000000000000000000000000000000;hpb=d422c3ce2641545c262cc6e09220c79f8d0a16e9;p=BackupPC.git diff --git a/init.d/src/gentoo-backuppc b/init.d/src/gentoo-backuppc new file mode 100755 index 0000000..e214941 --- /dev/null +++ b/init.d/src/gentoo-backuppc @@ -0,0 +1,45 @@ +#!/sbin/runscript +# +# DESCRIPTION +# +# Startup init script for BackupPC on Gentoo` linux. +# +# Distributed with BackupPC version __VERSION__, released __RELEASEDATE__. +# +# description: Starts and stops the BackupPC server +# Copy to /etc/init.d and run 'rc-update add backuppc default' + +# get our configuration options +source /etc/conf.d/backuppc + +checkconfig() { + if [ ! -f ${CONF_FILE} ] ; then + eeror "No ${CONF_FILE} exists!" + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting BackupPC" + start-stop-daemon --start --user ${USER} --pidfile ${PID_FILE} --exec ${EXEC} -- ${EXEC_OPTIONS} + eend $? +} + +stop() { + ebegin "Stopping BackupPC" + start-stop-daemon --stop --pidfile ${PID_FILE} --name BackupPC + eend $? +} + +restart() { + ebegin "Restarting BackupPC" + svc_stop + svc_start + eend $? "Failed to restart BackupPC" +} + +status() { + return + eend $? +} +