View | Details | Raw Unified | Return to bug 93815 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-61 / +1 lines)
Lines 19-30 Link Here
19
extra_commands="save load unload"
20
save_cmd="ipfw_save"
21
load_cmd="ipfw_load"
22
unload_cmd="ipfw_unload"
23
24
#gets the name of the save to use
25
if [ ! -z "$2" ]; then
26
	savename="$2"
27
	usingsave="yes"
28
else
29
	savename="last"
30
fi
Lines 44-82 Link Here
44
ipfw_save()
45
{
46
      # Saves the firewall rules to /var/db/ipfw/$savename
47
	[ ! -d /var/db/ipfw ] && mkdir /var/db/ipfw && chmod go-rwx /var/db/ipfw
48
	ipfw list | awk '{print "${fwcmd2} " $0 }' > /var/db/ipfw/$savename
49
}
50
51
ipfw_load()
52
{
53
54
    # Set quiet mode if requested
55
    case ${firewall_quiet} in
56
    [Yy][Ee][Ss])
57
	fwcmd2="/sbin/ipfw -q add"
58
	;;
59
    *)
60
	fwcmd2="/sbin/ipfw add"
61
	;;
62
    esac
63
64
    . /var/db/ipfw/$savename
65
}
66
67
ipfw_unload()
68
{
69
70
    # Set quiet mode if requested
71
    case ${firewall_quiet} in
72
    [Yy][Ee][Ss])
73
	fwcmd2="/sbin/ipfw -q delete"
74
	;;
75
    *)
76
	fwcmd2="/sbin/ipfw delete"
77
	;;
78
    esac
79
80
    . /var/db/ipfw/$savename
81
}
82
Lines 85-92 Link Here
85
	# Make sure the save file exists if one is specified
86
	if [ ! -z "$usingsave" ]; then
87
		if [ ! -f "/var/db/ipfw/$savename" ]; then
88
		    echo "Specified save does not exist"
89
		    exit 1
90
		fi
91
	fi
92
Line 97 Link Here
97
		. "${firewall_script}" $savename
38
		. "${firewall_script}"
98
--

Return to bug 93815