5 # chkconfig: 2345 90 25
6 # description: FROX Transparent FTP proxy
8 # Source function library
9 . /etc/rc.d/init.d/functions
15 # See how we were called.
18 # Check if the service is already running?
19 if [ ! -f /var/lock/subsys/frox ]; then
20 if [ ! "$IPCHAINS_RULE" ] && [ ! "$IPTABLES_RULE" ]; then
21 echo $(nls "Please edit /etc/sysconfig/frox")' !'
25 daemon frox -f /etc/frox.conf
27 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/frox
28 if [ -x /usr/sbin/iptables -a -n "$IPTABLES_RULE" ]; then
29 run_cmd "Redirecting FTP traffic" /usr/sbin/iptables -t nat -A $IPTABLES_RULE
31 if [ -x /sbin/ipchains -a -n "$IPCHAINS_RULE" ]; then
32 run_cmd "Redirecting FTP traffic" /sbin/ipchains -A $IPCHAINS_RULE
36 msg_already_running frox
41 if [ -f /var/lock/subsys/frox ]; then
42 if [ -x /usr/sbin/iptables -a -n "$IPTABLES_RULE" ]; then
43 run_cmd "Removing FTP traffic redirection" /usr/sbin/iptables -t nat -D $IPTABLES_RULE
45 if [ -x /sbin/ipchains -a -n "$IPCHAINS_RULE" ]; then
46 run_cmd "Removing FTP traffic redirection" /sbin/ipchains -D $IPCHAINS_RULE
50 rm -f /var/lock/subsys/frox /var/run/frox.pid >/dev/null 2>&1
65 msg_usage "$0 {start|stop|restart|force-reload|status}"