add upstream source (adch++ 2.12.1 from sourceforge)
This commit is contained in:
97
src/redhat/etc/init.d/adchppd
Executable file
97
src/redhat/etc/init.d/adchppd
Executable file
@@ -0,0 +1,97 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# chkconfig: - 91 35
|
||||
# description: Starts and stops the ADCH++ ( https://launchpad.net/adchpp ) daemons on RHEL\CentOS \
|
||||
# used to provide p2p network services.
|
||||
#
|
||||
# pidfile: /var/run/adchpp.pid
|
||||
# config: /etc/adchpp/adchpp.xml
|
||||
|
||||
|
||||
|
||||
# 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 1
|
||||
fi
|
||||
|
||||
# Source networking configuration.
|
||||
. /etc/sysconfig/network
|
||||
|
||||
if [ -f /etc/sysconfig/adchpp ]; then
|
||||
. /etc/sysconfig/adchpp
|
||||
fi
|
||||
|
||||
# Check that networking is up.
|
||||
[ ${NETWORKING} = "no" ] && exit 1
|
||||
|
||||
# Check that uhub.conf exists.
|
||||
[ -f /etc/adchpp/adchpp.xml ] || exit 6
|
||||
|
||||
RETVAL=0
|
||||
|
||||
|
||||
start() {
|
||||
KIND="ADCH++"
|
||||
echo -n $"Starting $KIND services: "
|
||||
daemon adchppd $ADCHPPOPTIONS
|
||||
RETVAL=$?
|
||||
echo ""
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
stop() {
|
||||
KIND="ADCH++"
|
||||
echo -n $"Shutting down $KIND services: "
|
||||
killproc adchppd
|
||||
RETVAL=$?
|
||||
echo ""
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
|
||||
rhstatus() {
|
||||
status adchpp
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -ne 0 ] ; then
|
||||
return $RETVAL
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
# Allow status as non-root.
|
||||
if [ "$1" = status ]; then
|
||||
rhstatus
|
||||
exit $?
|
||||
fi
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
status)
|
||||
rhstatus
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|restart|status}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit $?
|
||||
7
src/redhat/etc/sysconfig/adchpp
Normal file
7
src/redhat/etc/sysconfig/adchpp
Normal file
@@ -0,0 +1,7 @@
|
||||
# Usage: adchpp [[-c <configdir>] [-d]] | [-v] | [-h]
|
||||
# -c <configdir>
|
||||
# -v show version and exit
|
||||
# -d run in daemon mode
|
||||
# -h show help
|
||||
|
||||
ADCHPPOPTIONS="-d -c /etc/adchpp"
|
||||
Reference in New Issue
Block a user