#!/bin/sh
#----------------------------------------------------------------------------
# /etc/rc.d/rc200.iptimeout - set IP timeout values
#----------------------------------------------------------------------------
# optional package iptimeout, used if OPT_IPTIMEOUT='yes'
#----------------------------------------------------------------------------
# (c) copyright 2004 by Frank Zavelberg
# see instructions for the licensing terms and conditions
# last modified 2006-02-23
# Version 0.1.4
#----------------------------------------------------------------------------
# Change: 23.02.2006 by Michael Wenger (for fli4l 3.0.0)
#----------------------------------------------------------------------------

if [ "x${OPT_IPTIMEOUT}" = "xyes" ]; then
  begin_script IPTIMEOUT "Configuring IP protocol timeout values ..." 

  [ "x${IPTIMEOUT_TCP_CLOSE}" = "x" ] || echo $IPTIMEOUT_TCP_CLOSE > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_close
  [ "x${IPTIMEOUT_TCP_CLOSE_WAIT}" = "x" ] || echo $IPTIMEOUT_TCP_CLOSE_WAIT > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_close_wait
  [ "x${IPTIMEOUT_TCP_ESTABLISHED}" = "x" ] || echo $IPTIMEOUT_TCP_ESTABLISHED > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established
  [ "x${IPTIMEOUT_TCP_FIN_WAIT}" = "x" ] || echo $IPTIMEOUT_TCP_FIN_WAIT > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_fin_wait
  [ "x${IPTIMEOUT_TCP_LAST_ACK}" = "x" ] || echo $IPTIMEOUT_TCP_LAST_ACK > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_last_ack
  [ "x${IPTIMEOUT_TCP_SYN_RECV}" = "x" ] || echo $IPTIMEOUT_TCP_SYN_RECV > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_syn_recv
  [ "x${IPTIMEOUT_TCP_SYN_SENT}" = "x" ] || echo $IPTIMEOUT_TCP_SYN_SENT > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_syn_sent
  [ "x${IPTIMEOUT_TCP_TIME_WAIT}" = "x" ] || echo $IPTIMEOUT_TCP_TIME_WAIT > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_time_wait
  [ "x${IPTIMEOUT_UDP}" = "x" ] || echo $IPTIMEOUT_UDP > /proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout
  [ "x${IPTIMEOUT_UDP_STREAM}" = "x" ] || echo $IPTIMEOUT_UDP_STREAM > /proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout_stream

  end_script
fi
