summaryrefslogtreecommitdiffstats
path: root/network/shorewall-common/doinst.sh
blob: 8ce6a72e49019a7c2140148efe2624f41a05b87d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
config() {
  NEW="$1"
  OLD="${NEW%*.new}"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

# Keep same perms on rc.firewall.new:
if [ -e etc/rc.d/rc.firewall ]; then
  cp -a etc/rc.d/rc.firewall etc/rc.d/rc.firewall.new.incoming
  cat etc/rc.d/rc.firewall.new > etc/rc.d/rc.firewall.new.incoming
  mv etc/rc.d/rc.firewall.new.incoming etc/rc.d/rc.firewall.new
fi
# Keep same perms on rc.shorewall.new:
if [ -e etc/rc.d/rc.shorewall ]; then
  cp -a etc/rc.d/rc.shorewall etc/rc.d/rc.shorewall.new.incoming
  cat etc/rc.d/rc.shorewall.new > etc/rc.d/rc.shorewall.new.incoming
  mv etc/rc.d/rc.shorewall.new.incoming etc/rc.d/rc.shorewall.new
fi

config etc/rc.d/rc.firewall.new
config etc/rc.d/rc.shorewall.new

config etc/shorewall/accounting.new
config etc/shorewall/actions.new
config etc/shorewall/blacklist.new
config etc/shorewall/continue.new
config etc/shorewall/ecn.new
config etc/shorewall/hosts.new
config etc/shorewall/init.new
config etc/shorewall/initdone.new
config etc/shorewall/interfaces.new
config etc/shorewall/ipsec.new
config etc/shorewall/maclist.new
config etc/shorewall/masq.new
config etc/shorewall/nat.new
config etc/shorewall/netmap.new
config etc/shorewall/notrack.new
config etc/shorewall/params.new
config etc/shorewall/policy.new
config etc/shorewall/providers.new
config etc/shorewall/proxyarp.new
config etc/shorewall/restored.new
config etc/shorewall/route_rules.new
config etc/shorewall/routestopped.new
config etc/shorewall/rules.new
config etc/shorewall/shorewall.conf.new
config etc/shorewall/start.new
config etc/shorewall/started.new
config etc/shorewall/stop.new
config etc/shorewall/stopped.new
config etc/shorewall/tcclasses.new
config etc/shorewall/tcdevices.new
config etc/shorewall/tcfilters.new
config etc/shorewall/tcrules.new
config etc/shorewall/tos.new
config etc/shorewall/tunnels.new
config etc/shorewall/zones.new