richard: server/kolabd/kolabd/dist_conf kolabsrv.in,NONE,1.1
cvs at intevation.de
cvs at intevation.de
Thu Jan 5 22:45:48 CET 2006
Author: richard
Update of /kolabrepository/server/kolabd/kolabd/dist_conf
In directory doto:/tmp/cvs-serv305/dist_conf
Added Files:
kolabsrv.in
Log Message:
initial checkin of kolabsrv. This script should replace the ...openpkg script
--- NEW FILE: kolabsrv.in ---
#!/bin/bash
# check if everything is correct
function check() {
if [ $SERVICE = "openldap" ]; then
SERVICE="ldap"
fi
if [ -x "$RCDIR/$SERVICE" ]; then
case $PARAM in
start|START) PARAM="start" && rcrun;;
stop|STOP) PARAM="stop" && rcrun;;
restart|RESTART) PARAM="restart" && rcrun;;
reload|RELOAD) PARAM="reload" && rcrun;;
status|STATUS) PARAM="status" && rcrun;;
*) echo "ERROR: Parameter $PARAM not supported!"
esac
else
echo "ERROR $RCDIR/$SERVICE NOT found - abort"
fi
}
# starts/stops/restarts... the service
function rcrun() {
$RCDIR/$SERVICE $PARAM
retc=$?
if [ $retc -ne 0 ] && [ $retc -ne 3 ]; then
( echo "ERROR: $RCDIR/$SERVICE $PARAM failed"
echo "Run: /usr/sbin/kolab rc all stop"
echo "to stop all services"
) >&2
exit 1
fi
}
# variables
RC=$1
case $RC in
rc) ;; # okay
*) echo "ERROR: $1 not supported";;
esac
if [[ "$2" == "all" ]]; then
SERVICES="ldap saslauthd spamd amavis apache2 clamd cyrus postfix"
# SERVICES="$SERVICES kolab"
else
SERVICES=$2
fi
PARAM=$3
#RCDIR=@rc_dir@
RCDIR=/etc/init.d
for SERVICE in $SERVICES; do
check $SERVICE
done
More information about the commits
mailing list