Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-release > by-pkgid > 7cd88a18018961a2a37645fa13f656bd > files > 2

freepops-0.2.9-15.mga6.armv5tl.rpm

#!/bin/bash
#
# freepopsd This starts and stops freepopsd.
#
# chkconfig: - 56 50
# description: FreePOPs
#
# processname: /usr/bin/freepopsd
# config: /etc/sysconfig/network
# pidfile: /var/run/freepopsd.pid
### BEGIN INIT INFO
# Provides: freepopsd
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 4 5
# Short-Description: FreePOPs
# Description: POP3 interface to various webmail systems
### END INIT INFO

PATH=/sbin:/bin:/usr/bin:/usr/sbin

# Source function library.
. /etc/init.d/functions

# Get config.
test -f /etc/sysconfig/network && . /etc/sysconfig/network

# More config

[ -f /etc/sysconfig/freepopsd ] || exit 1
. /etc/sysconfig/freepopsd

# Check that we are root ... so non-root users stop here
[ `id -u` = 0 ] || exit 1

# Check that networking is up.
[ "${NETWORKING}" = "yes" ] || exit 0


RETVAL=0

prog="freepopsd"

start(){
    gprintf "Starting %s: " "$prog"

    daemon $prog -d $FREEPOPSDARG
    RETVAL=$?
    echo
    touch /var/lock/subsys/freepopsd
    return $RETVAL
}

stop(){
    gprintf "Stopping %s: " "$prog"
    killproc $prog
    RETVAL=$?
    echo
    rm -f /var/lock/subsys/freepopsd
    return $RETVAL

}

reload(){
    gprintf "Reloading configuration: "	
    killproc $prog -HUP
    RETVAL=$?
    echo
    return $RETVAL
}

restart(){
    stop
    start
}

condrestart(){
    [ -e /var/lock/subsys/freepopsd ] && restart
    return 0
}


# See how we were called.
case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    status)
	status $prog
	;;
    restart)
	restart
	;;
    reload)
	reload
	;;
    condrestart)
	condrestart
	;;
    *)
	gprintf "Usage: %s {start|stop|status|restart|condrestart|reload}\n" "$0"
	RETVAL=1
esac

exit $RETVAL