redface n00b
Joined: 21 Dec 2004 Posts: 1
|
Posted: Tue Dec 21, 2004 3:30 am Post subject: IBS ISP Billing Sftware |
|
|
Hi All,
Is there anyone already installed IBS ISP Billing Software in Gentoo? http://ibs.sourceforge.net/ I already installed it but i cant make the init script work. may be someone can help me with this?
the script is for Redhat/Fedora Distro..
Can somebody help me convert this in gentoo startup script?
#!/bin/sh
# Startup script for IBS
#
# chkconfig: 2345 95 05
# description: Run/Shutdown Isp Billing System
# Source function library.
. /etc/rc.d/init.d/functions
prog="ibs.py"
ibs_check="ibs_check.py"
ibs_root="/usr/local/ibs"
export LD_ASSUME_KERNEL=2.4.1 #prevent python deadlocks
startibs_check() {
echo "Starting IBS Checker process:"
daemon $ibs_root/sc/$ibs_check
RETVAL=$?
echo
return $RETVAL
}
startibs() {
echo -n $"Starting IBS Core: "
/sbin/modprobe sch_tbf >/dev/null 2>&1
daemon -1 $ibs_root/$prog
echo
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
/usr/bin/killall $prog
RETVAL=$?
c=0
while [ \( "`ps x|grep ibs.py|grep -v grep`" != "" \) -a \( $c -lt 20 \) ]; do
sleep 1
echo -n "."
c=$((c+1))
done
/usr/bin/killall -9 ibs.py >/dev/null 2>&1
/usr/bin/killall ibs_check.py
if [ $RETVAL = 0 ]; then
success
else
failure
fi
echo
return $RETVAL
}
case "$1" in
start)
startibs
startibs_check
;;
stop)
stop
;;
status)
status $prog
;;
restart)
stop
sleep 1
startibs
startibs_check
;;
startibs)
startibs
;;
*)
echo $"Usage: $0 {start|startibs|stop|restart|status}"
exit 1
esac
exit 0 |
|