mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-16 03:10:39 +01:00
Cosmetic changes to generated script
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6766 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
70690de951
commit
82428d66bc
@ -84,29 +84,13 @@ sub reinitialize() {
|
||||
|
||||
sub generate_script_1() {
|
||||
|
||||
copy $globals{SHAREDIRPL} . 'prog.header';
|
||||
|
||||
my $date = localtime;
|
||||
|
||||
emit "#\n# Compiled firewall script generated by Shorewall-perl $globals{VERSION} - $date\n#";
|
||||
emit "#!/bin/sh\n#\n# Compiled firewall script generated by Shorewall-perl $globals{VERSION} - $date\n#";
|
||||
|
||||
if ( $export ) {
|
||||
emitj ( 'SHAREDIR=/usr/share/shorewall-lite',
|
||||
'CONFDIR=/etc/shorewall-lite',
|
||||
'VARDIR=/var/lib/shorewall-lite',
|
||||
'PRODUCT="Shorewall Lite"'
|
||||
);
|
||||
} else {
|
||||
emitj ( 'SHAREDIR=/usr/share/shorewall',
|
||||
'CONFDIR=/etc/shorewall',
|
||||
'VARDIR=/var/lib/shorewall',
|
||||
'PRODUCT=\'Shorewall\'',
|
||||
);
|
||||
}
|
||||
copy $globals{SHAREDIRPL} . 'prog.header';
|
||||
|
||||
emit "TEMPFILE=\n";
|
||||
|
||||
for my $exit qw/init start tcclear started stop stopped clear/ {
|
||||
for my $exit qw/init start tcclear started stop stopped clear refresh/ {
|
||||
emit "run_${exit}_exit() {";
|
||||
push_indent;
|
||||
append_file $exit or emit 'true';
|
||||
@ -123,12 +107,28 @@ sub generate_script_1() {
|
||||
|
||||
push_indent;
|
||||
|
||||
if ( $export ) {
|
||||
emitj ( 'SHAREDIR=/usr/share/shorewall-lite',
|
||||
'CONFDIR=/etc/shorewall-lite',
|
||||
'VARDIR=/var/lib/shorewall-lite',
|
||||
'PRODUCT="Shorewall Lite"'
|
||||
);
|
||||
} else {
|
||||
emitj ( 'SHAREDIR=/usr/share/shorewall',
|
||||
'CONFDIR=/etc/shorewall',
|
||||
'VARDIR=/var/lib/shorewall',
|
||||
'PRODUCT=\'Shorewall\'',
|
||||
);
|
||||
}
|
||||
|
||||
if ( $export ) {
|
||||
emit ( 'CONFIG_PATH="/etc/shorewall-lite:/usr/share/shorewall-lite"' );
|
||||
} else {
|
||||
emit ( qq(CONFIG_PATH="$config{CONFIG_PATH}") );
|
||||
}
|
||||
|
||||
emit 'TEMPFILE=';
|
||||
|
||||
propagateconfig;
|
||||
|
||||
emitj ( '[ -n "${COMMAND:=restart}" ]',
|
||||
@ -627,14 +627,17 @@ if [ $COMMAND = restore ]; then
|
||||
fi
|
||||
set_state "Started"
|
||||
else
|
||||
setup_netfilter
|
||||
restore_dynamic_rules
|
||||
run_start_exit
|
||||
$IPTABLES -N shorewall
|
||||
set_state "Started"
|
||||
run_started_exit
|
||||
|
||||
cp -f $(my_pathname) ${VARDIR}/.restore
|
||||
if [ $COMMAND = refresh ]; then
|
||||
run_refresh_exit
|
||||
else
|
||||
setup_netfilter
|
||||
restore_dynamic_rules
|
||||
run_start_exit
|
||||
$IPTABLES -N shorewall
|
||||
set_state "Started"
|
||||
run_started_exit
|
||||
cp -f $(my_pathname) ${VARDIR}/.restore
|
||||
fi
|
||||
fi
|
||||
|
||||
date > ${VARDIR}/restarted
|
||||
|
@ -1,17 +1,20 @@
|
||||
--- ../Shorewall-common/lib.base 2007-07-02 15:50:32.000000000 -0700
|
||||
+++ prog.header 2007-07-02 16:50:14.000000000 -0700
|
||||
@@ -1,48 +1,29 @@
|
||||
#!/bin/sh
|
||||
+++ prog.header 2007-07-03 10:27:47.000000000 -0700
|
||||
@@ -1,48 +1,28 @@
|
||||
-#!/bin/sh
|
||||
+# This program is under GPL [http://www.gnu.org/copyleft/gpl.htm]
|
||||
#
|
||||
-# Shorewall 4.0 -- /usr/share/shorewall/lib.base
|
||||
+# Generated by the Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.0
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/copyleft/gpl.htm]
|
||||
#
|
||||
-# (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007 - Tom Eastep (teastep@shorewall.net)
|
||||
+# (c) 2006,2007 - Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
-# This program is under GPL [http://www.gnu.org/copyleft/gpl.htm]
|
||||
#
|
||||
-# (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007 - Tom Eastep (teastep@shorewall.net)
|
||||
+# Options are:
|
||||
#
|
||||
-# Complete documentation is available at http://shorewall.net
|
||||
+# -n Don't alter Routing
|
||||
+# -v and -q Standard Shorewall Verbosity control
|
||||
#
|
||||
-# This program is free software; you can redistribute it and/or modify
|
||||
-# it under the terms of Version 2 of the GNU General Public License
|
||||
@ -48,11 +51,6 @@
|
||||
-SHELLSHAREDIR=/usr/share/shorewall-shell
|
||||
-PERLSHAREDIR=/usr/share/shorewall-perl
|
||||
-
|
||||
+# Options are:
|
||||
+#
|
||||
+# -n Don't alter Routing
|
||||
+# -v and -q Standard Shorewall Verbosity control
|
||||
+#
|
||||
+# Commands are:
|
||||
+#
|
||||
+# start Starts the firewall
|
||||
@ -65,10 +63,13 @@
|
||||
+# version Displays the version of Shorewall that
|
||||
+# generated this program
|
||||
+#
|
||||
+################################################################################
|
||||
+# Functions imported from /usr/share/shorewall/lib.base
|
||||
+################################################################################
|
||||
#
|
||||
# Message to stderr
|
||||
#
|
||||
@@ -111,20 +92,6 @@
|
||||
@@ -111,20 +91,6 @@
|
||||
}
|
||||
|
||||
#
|
||||
@ -89,7 +90,7 @@
|
||||
# Suppress all output for a command
|
||||
#
|
||||
qt()
|
||||
@@ -310,83 +277,6 @@
|
||||
@@ -310,83 +276,6 @@
|
||||
}
|
||||
|
||||
#
|
||||
@ -173,7 +174,7 @@
|
||||
# Note: The following set of IP address manipulation functions have anomalous
|
||||
# behavior when the shell only supports 32-bit signed arithmatic and
|
||||
# the IP address is 128.0.0.0 or 128.0.0.1.
|
||||
@@ -607,40 +497,6 @@
|
||||
@@ -607,40 +496,6 @@
|
||||
fi
|
||||
}
|
||||
|
||||
@ -214,7 +215,7 @@
|
||||
#
|
||||
# Query NetFilter about the existence of a filter chain
|
||||
#
|
||||
@@ -879,21 +735,6 @@
|
||||
@@ -879,21 +734,6 @@
|
||||
}
|
||||
|
||||
#
|
||||
@ -236,7 +237,7 @@
|
||||
# Find a File -- For relative file name, look in each ${CONFIG_PATH} then ${CONFDIR}
|
||||
#
|
||||
find_file()
|
||||
@@ -918,54 +759,6 @@
|
||||
@@ -918,54 +758,6 @@
|
||||
}
|
||||
|
||||
#
|
||||
@ -291,7 +292,7 @@
|
||||
# Set the Shorewall state
|
||||
#
|
||||
set_state () # $1 = state
|
||||
@@ -974,200 +767,6 @@
|
||||
@@ -974,200 +766,6 @@
|
||||
}
|
||||
|
||||
#
|
||||
@ -492,7 +493,7 @@
|
||||
# Delete IP address
|
||||
#
|
||||
del_ip_addr() # $1 = address, $2 = interface
|
||||
@@ -1286,82 +885,6 @@
|
||||
@@ -1286,82 +884,6 @@
|
||||
cut -b -${1}
|
||||
}
|
||||
|
||||
@ -575,7 +576,7 @@
|
||||
delete_tc1()
|
||||
{
|
||||
clear_one_tc() {
|
||||
@@ -1496,65 +1019,3 @@
|
||||
@@ -1496,65 +1018,6 @@
|
||||
|
||||
echo echo
|
||||
}
|
||||
@ -641,3 +642,6 @@
|
||||
- esac
|
||||
- fi
|
||||
-}
|
||||
+################################################################################
|
||||
+# End of functions imported from /usr/share/shorewall/lib.base
|
||||
+################################################################################
|
||||
|
@ -1,7 +1,3 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Generated by the Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.0
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/copyleft/gpl.htm]
|
||||
#
|
||||
# (c) 2006,2007 - Tom Eastep (teastep@shorewall.net)
|
||||
@ -24,6 +20,9 @@
|
||||
# version Displays the version of Shorewall that
|
||||
# generated this program
|
||||
#
|
||||
################################################################################
|
||||
# Functions imported from /usr/share/shorewall/lib.base
|
||||
################################################################################
|
||||
#
|
||||
# Message to stderr
|
||||
#
|
||||
@ -1019,3 +1018,6 @@ find_echo() {
|
||||
|
||||
echo echo
|
||||
}
|
||||
################################################################################
|
||||
# End of functions imported from /usr/share/shorewall/lib.base
|
||||
################################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user