source: bootscripts-standard/cblfs/init.d/iptables@ 2167cfe

Last change on this file since 2167cfe was 7df280d, checked in by Joe Ciccone <jciccone@…>, 17 years ago

Change /bin/sh to /bin/bash in the bootscripts because the bootscripts use bashisms. Having ash linked to sh will cause errors. Thanks to Bigdassaved for providing the diff and Copper for bring up the issue.

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[7df280d]1#!/bin/bash
[7125722]2# Begin $rc_base/init.d/iptables
3
4#$LastChangedBy: bdubbs $
5#$Date: 2005-08-01 14:29:19 -0500 (Mon, 01 Aug 2005) $
6
7. /etc/sysconfig/rc
8. $rc_functions
9
10case "$1" in
11 start)
12 if [ -x /etc/rc.d/rc.iptables ]; then
13 boot_mesg "Starting iptables..."
14 loadproc /etc/rc.d/rc.iptables
15 fi
16 ;;
17
18 lock)
19 boot_mesg "Locking system iptables firewall..."
20 /sbin/iptables --policy INPUT DROP
21 /sbin/iptables --policy OUTPUT DROP
22 /sbin/iptables --policy FORWARD DROP
23 /sbin/iptables --flush
24 /sbin/iptables -t nat --flush
25 /sbin/iptables -t mangle --flush
26 /sbin/iptables --delete-chain
27 /sbin/iptables -t nat --delete-chain
28 /sbin/iptables -t mangle --delete-chain
29 /sbin/iptables -A INPUT -i lo -j ACCEPT
30 /sbin/iptables -A OUTPUT -o lo -j ACCEPT
31 boot_mesg_flush
32 ;;
33
34 clear)
35 boot_mesg "Clearing system iptables iptables..."
36 /sbin/iptables --policy INPUT ACCEPT
37 /sbin/iptables --policy OUTPUT ACCEPT
38 /sbin/iptables --policy FORWARD ACCEPT
39 /sbin/iptables --flush
40 /sbin/iptables -t nat --flush
41 /sbin/iptables -t mangle --flush
42 /sbin/iptables --delete-chain
43 /sbin/iptables -t nat --delete-chain
44 /sbin/iptables -t mangle --delete-chain
45 boot_mesg_flush
46 ;;
47
48 status)
49 /sbin/iptables --numeric --list
50 /sbin/iptables -t nat --numeric --list
51 /sbin/iptables -t mangle --numeric --list
52 ;;
53
54 *)
55 echo "Usage: $0 {start|clear|lock|status}"
56 exit 1
57 ;;
58esac
59
60# End $rc_base/init.d/iptables
Note: See TracBrowser for help on using the repository browser.