Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release-src > by-pkgid > f5a5a462592eb6a911db314d83b492b8 > files > 11

freepops-0.2.9-14.mga5.src.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(){
    echo -n $"Starting $prog: "

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

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

}

reload(){
    echo -n $"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
	;;
    *)
	echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
	RETVAL=1
esac

exit $RETVAL