Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2393 → Rev 2394

/alcasar.sh
1174,65 → 1174,65
CONFIG=/etc/chilli.conf
pidfile=/var/run/chilli.pid
[ -f \$CONFIG ] || {
echo "\$CONFIG Not found"
exit 0
echo "\$CONFIG Not found"
exit 0
}
current_users_file="/var/tmp/havp/current_users.txt" # file containing active users
RETVAL=0
prog="chilli"
case \$1 in
start)
if [ -f \$pidfile ] ; then
gprintf "chilli is already running"
else
gprintf "Starting \$prog: "
[ -e \$current_users_file ] && echo '' > \$current_users_file
rm -f /var/run/chilli* # cleaning
/usr/sbin/modprobe tun >/dev/null 2>&1
echo 1 > /proc/sys/net/ipv4/ip_forward
[ -e /dev/net/tun ] || {
(cd /dev;
mkdir net;
cd net;
mknod tun c 10 200)
}
ifconfig $INTIF 0.0.0.0
/usr/sbin/ethtool -K $INTIF gro off
daemon /usr/sbin/chilli -c \$CONFIG --pidfile=\$pidfile &
RETVAL=\$?
fi
;;
start)
if [ -f \$pidfile ] ; then
gprintf "chilli is already running"
else
gprintf "Starting \$prog: "
echo '' > \$current_users_file && chown apache:apache \$current_users_file
rm -f /var/run/chilli* # cleaning
/usr/sbin/modprobe tun >/dev/null 2>&1
echo 1 > /proc/sys/net/ipv4/ip_forward
[ -e /dev/net/tun ] || {
(cd /dev;
mkdir net;
cd net;
mknod tun c 10 200)
}
ifconfig $INTIF 0.0.0.0
/usr/sbin/ethtool -K $INTIF gro off
daemon /usr/sbin/chilli -c \$CONFIG --pidfile=\$pidfile &
RETVAL=\$?
fi
;;
 
reload)
killall -HUP chilli
;;
reload)
killall -HUP chilli
;;
 
restart)
\$0 stop
sleep 2
\$0 start
;;
status)
status chilli
RETVAL=0
;;
restart)
\$0 stop
sleep 2
\$0 start
;;
 
stop)
if [ -f \$pidfile ] ; then
gprintf "Shutting down \$prog: "
killproc /usr/sbin/chilli
RETVAL=\$?
[ \$RETVAL = 0 ] && rm -f \$pidfile
[ -e \$current_users_file ] && rm -f \$current_users_file
else
gprintf "chilli is not running"
fi
;;
*)
echo "Usage: \$0 {start|stop|restart|reload|status}"
exit 1
status)
status chilli
RETVAL=0
;;
 
stop)
if [ -f \$pidfile ] ; then
gprintf "Shutting down \$prog: "
killproc /usr/sbin/chilli
RETVAL=\$?
[ \$RETVAL = 0 ] && rm -f \$pidfile
[ -e \$current_users_file ] && rm -f \$current_users_file
else
gprintf "chilli is not running"
fi
;;
 
*)
echo "Usage: \$0 {start|stop|restart|reload|status}"
exit 1
esac
echo
EOF