home *** CD-ROM | disk | FTP | other *** search
/ chilidog.highland.cc.ks.us / chilidog.highland.cc.ks.us.zip / chilidog.highland.cc.ks.us / backup / bradford.20120305.etc.tar.gz / bradford.20120305.etc.tar / etc / init.d / boot.ipconfig < prev    next >
Text File  |  2004-09-08  |  3KB  |  135 lines

  1. #! /bin/sh
  2. #
  3. # Copyright (c) 2001-2002 SuSE Linux AG, Nuernberg, Germany.
  4. # All rights reserved.
  5. #
  6. # /etc/init.d/boot.ipconfig
  7. #
  8. ### BEGIN INIT INFO
  9. # Provides:          boot.ipconfig
  10. # Required-Start: 
  11. # Should-Start: setserial boot.isapnp boot.sysctl
  12. # Required-Stop:
  13. # Default-Start:     B
  14. # Default-Stop:
  15. # Description:       run ip configuration hooks
  16. ### END INIT INFO
  17.  
  18. . /etc/rc.status
  19. . /etc/sysconfig/sysctl
  20.  
  21. rc_reset
  22.  
  23. case "$1" in
  24.   start|restart)
  25.    #
  26.    # Enable "dynamic IP patch"
  27.    #
  28.    if test -n "$IP_DYNIP" -a "$IP_DYNIP" != no -a \
  29.     -e /proc/sys/net/ipv4/ip_dynaddr ; then
  30.     echo -n "Enabling dynamic IP patch"
  31.     case "$IP_DYNIP" in
  32.     yes)    echo 7         ; ECHO_RETURN=$rc_done ;;
  33.     [1-9])  echo $IP_DYNIP ; ECHO_RETURN=$rc_done ;;
  34.     *)      ECHO_RETURN=" invalid IP_DYNIP=$IP_DYNIP $rc_skipped" ;;
  35.     esac > /proc/sys/net/ipv4/ip_dynaddr || ECHO_RETURN=$rc_failed
  36.     echo -e "$ECHO_RETURN"
  37.    fi
  38.  
  39.    #
  40.    # Enable syn flood protection
  41.    #
  42.    if test -n "$IP_TCP_SYNCOOKIES" -a "$IP_TCP_SYNCOOKIES" != no -a \
  43.     -e /proc/sys/net/ipv4/tcp_syncookies ; then
  44.     echo -n "Enabling syn flood protection"
  45.     case "$IP_TCP_SYNCOOKIES" in
  46.         yes)    echo 1         ; ECHO_RETURN=$rc_done ;;
  47.         *)      ECHO_RETURN=" invalid IP_TCP_SYNCOOKIES=$IP_TCP_SYNCOOKIES $rc_skipped" ;;
  48.     esac > /proc/sys/net/ipv4/tcp_syncookies || ECHO_RETURN=$rc_failed
  49.     echo -e "$ECHO_RETURN"
  50.    fi
  51.  
  52.  
  53.    #
  54.    # Enable IP forwarding ?
  55.    #
  56.    if test -e /proc/sys/net/ipv4/ip_forward -a -n "$IP_FORWARD" ; then
  57.     case $IP_FORWARD in
  58.       yes)
  59.         echo -n "Enabling IP forwarding"
  60.         echo "1" > /proc/sys/net/ipv4/ip_forward
  61.       ;;
  62.       *)
  63.         echo -n "Disabling IP forwarding"
  64.         echo "0" > /proc/sys/net/ipv4/ip_forward
  65.       ;;
  66.     esac
  67.     rc_status -v -r
  68.    fi
  69.    #
  70.    # Enable IPv6 forwarding ?
  71.    #
  72.    LOAD_IPV6="no"
  73.    case $IPV6_FORWARD in
  74.       yes) LOAD_IPV6="yes" ;;
  75.    esac
  76.    case $IPV6_PRIVACY in
  77.       yes) LOAD_IPV6="yes" ;;
  78.    esac
  79.    test -n "$IPV6_MLD_VERSION" && LOAD_IPV6="yes"
  80.    test "$LOAD_IPV6" = "yes" && /sbin/modprobe ipv6 >/dev/null 2>&1
  81.    #
  82.    if test -e /proc/sys/net/ipv6/conf/all/forwarding -a -n "$IPV6_FORWARD" ; then
  83.     case $IPV6_FORWARD in
  84.       yes)
  85.     echo -n "Enabling IPv6 forwarding"
  86.     echo "1" > /proc/sys/net/ipv6/conf/all/forwarding
  87.     ;;
  88.       *)
  89.     echo -n "Disabling IPv6 forwarding"
  90.     echo "0" > /proc/sys/net/ipv6/conf/all/forwarding
  91.     ;;
  92.     esac
  93.     rc_status -v -r
  94.    fi
  95.     #
  96.     # Enable IPv6 privacy?
  97.     #
  98.     if test -e /proc/sys/net/ipv6/conf/all/use_tempaddr -a -n "$IPV6_PRIVACY"; then
  99.     case $IPV6_PRIVACY in
  100.       yes)
  101.        echo -n "Enabling IPv6 privacy"
  102.        echo "1" > /proc/sys/net/ipv6/conf/all/use_tempaddr
  103.        ;;
  104.       *)
  105.        echo -n "Disabling IPv6 privacy"
  106.        echo "0" > /proc/sys/net/ipv6/conf/all/use_tempaddr
  107.        ;;
  108.     esac
  109.     rc_status -v -r
  110.     fi
  111.     #
  112.     # Set MLD version?
  113.     #
  114.     if test -e /proc/sys/net/ipv6/conf/all/force_mld_version -a -n "$IPV6_MLD_VERSION"; then
  115.     echo -n "Setting MLD version to $IPV6_MLD_VERSION"
  116.     echo "$IPV6_MLD_VERSION" > /proc/sys/net/ipv6/conf/all/force_mld_version
  117.     fi
  118.     rc_status -v -r
  119.    ;;
  120.   stop)
  121.     # skip / nothing to do
  122.     ;;
  123.   status)
  124.     rc_failed 4
  125.     rc_status -v
  126.     ;;
  127.   *)
  128.     echo "Usage: $0 {start|stop|status|restart}"
  129.     exit 1
  130.     ;;
  131. esac
  132.  
  133. rc_exit
  134.  
  135.