Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > c3e0bd855de9f7b14dd7c22152e98985 > files > 7

BackupPC-3.1.0-17.fc15.i686.rpm

#!/bin/sh
#
# DESCRIPTION
#
#   Startup init script for BackupPC on Redhat linux.
#
# Distributed with BackupPC version 3.1.0, released 25 Nov 2007.
#
# chkconfig: - 91 35
# description: Starts and stops the BackupPC server

# Source function library.
if [ -f /etc/init.d/functions ] ; then
  . /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
  . /etc/rc.d/init.d/functions
else
  exit 0
fi

RETVAL=0

start() {
    #
    # You can set the SMB share password here is you wish.  Otherwise
    # you should put it in the config.pl script.
    # If you put it here make sure this file has no read permissions
    # for normal users!  See the documentation for more information.
    #
    # Replace the daemon line below with this:
    #   
    #  daemon --user backuppc /usr/bin/env BPC_SMB_PASSWD=xxxxx \
    #				/usr/share/BackupPC/bin/BackupPC -d
    #   
    echo -n "Starting BackupPC: "
    daemon --user backuppc /usr/share/BackupPC/bin/BackupPC -d
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/backuppc || \
       RETVAL=1
    return $RETVAL
}	

stop() {
    echo -n "Shutting down BackupPC: "
    killproc /usr/share/BackupPC/bin/BackupPC
    RETVAL=$?
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/backuppc
    echo ""
    return $RETVAL
}	

restart() {
    stop
    start
}	

reload() {
    echo -n "Reloading config.pl file: "
    killproc /usr/share/BackupPC/bin/BackupPC -HUP
    RETVAL=$?
    echo
    return $RETVAL
}	

rhstatus() {
    status /usr/share/BackupPC/bin/BackupPC
}

case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  restart)
  	restart
	;;
  reload)
  	reload
	;;
  status)
  	rhstatus
	;;
  *)
	echo "Usage: $0 {start|stop|restart|reload|status}"
	exit 1
esac

exit $?