Implement 'upgrade' and delete the '-u' and '-a' options of 'check'.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2011-06-18 17:39:44 -07:00
parent 55242d1ed6
commit df2f7ec6a5
6 changed files with 122 additions and 39 deletions

View File

@ -1,6 +1,6 @@
Changes in Shorewall 4.4.21 Beta 2 Changes in Shorewall 4.4.21 Beta 2
1) Add -u option to check. 1) Implement the 'upgrade' command.
Changes in Shorewall 4.4.21 Beta 1 Changes in Shorewall 4.4.21 Beta 1

View File

@ -80,15 +80,20 @@ None.
DROP_DEFAULT=Drop(-,DROP) DROP_DEFAULT=Drop(-,DROP)
4) The 'check' command now allows a '-u' (upgrade) option that 4) An 'upgrade' command has been added that validates the
upgrades your /etc/shorewall[6]/shorewall[6].conf file. The configuration and then upgrades the shorewall.conf
upgraded file will set any new options with their default values (shorewall6.conf) file. The upgraded file will set any new options
and will move any deprecated options with non-default values to a with their default values and will move any deprecated options with
'deprecated options' section at the end of the file. Each such non-default values to a 'deprecated options' section at the end of
deprecated option will generate a warning message. the file. Each such deprecated option will generate a warning
message.
Your original shorewall[6].conf file will be saved as Your original shorewall.conf (shorewall6.conf) file will be saved as
shorewall[6].conf.bak. shorewall.conf.bak (shorewall6.conf.bak).
The 'upgrade' command accepts the same options as 'check' plus an
'-a' option that causes the upgraded file to be annotated with
documentation.
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
I V. R E L E A S E 4 . 4 H I G H L I G H T S I V. R E L E A S E 4 . 4 H I G H L I G H T S

View File

@ -688,10 +688,6 @@ check_command() {
g_confess=Yes g_confess=Yes
option=${option#T} option=${option#T}
;; ;;
u*)
g_upgrade=Yes
option=${option#u}
;;
a*) a*)
g_annotate=Yes g_annotate=Yes
option=${option#a} option=${option#a}
@ -1408,7 +1404,7 @@ usage() # $1 = exit status
echo "where <command> is one of:" echo "where <command> is one of:"
echo " add <interface>[:<host-list>] ... <zone>" echo " add <interface>[:<host-list>] ... <zone>"
echo " allow <address> ..." echo " allow <address> ..."
echo " check [ -e ] [ -r ] [ <directory> ]" echo " check [ -e ] [ -r ] [ -p ] [ -r ] [ -T ] [ <directory> ]"
echo " clear" echo " clear"
echo " compile [ -e ] [ -d ] [ <directory name> ] [ <path name> ]" echo " compile [ -e ] [ -d ] [ <directory name> ] [ <path name> ]"
echo " delete <interface>[:<host-list>] ... <zone>" echo " delete <interface>[:<host-list>] ... <zone>"
@ -1459,6 +1455,7 @@ usage() # $1 = exit status
echo " version [ -a ]" echo " version [ -a ]"
echo " safe-start [ <directory> ]" echo " safe-start [ <directory> ]"
echo " safe-restart [ <directory> ]" echo " safe-restart [ <directory> ]"
echo " upgrade [ -e ] [ -d ] [ -p ] [ -r ] [ -T ] [ -a ] [ <directory> ]"
echo echo
exit $1 exit $1
} }
@ -1749,6 +1746,12 @@ case "$COMMAND" in
shift shift
check_command $@ check_command $@
;; ;;
upgrade)
get_config Yes
shift
g_upgrade=Yes
check_command $@
;;
show|list) show|list)
get_config Yes No Yes get_config Yes No Yes
shift shift

View File

@ -689,10 +689,6 @@ check_command() {
g_confess=Yes g_confess=Yes
option=${option#T} option=${option#T}
;; ;;
u*)
g_upgrade=Yes
option=${option#u}
;;
a*) a*)
g_annotate=Yes g_annotate=Yes
option=${option#a} option=${option#a}
@ -1409,7 +1405,7 @@ usage() # $1 = exit status
echo "where <command> is one of:" echo "where <command> is one of:"
echo " add <interface>[:<host-list>] ... <zone>" echo " add <interface>[:<host-list>] ... <zone>"
echo " allow <address> ..." echo " allow <address> ..."
echo " check [ -e ] [ -r ] [ <directory> ]" echo " check [ -e ] [ -r ] [ -p ] [ -r ] [ -T ] [ <directory> ]"
echo " clear" echo " clear"
echo " compile [ -e ] [ -d ] [ <directory name> ] [ <path name> ]" echo " compile [ -e ] [ -d ] [ <directory name> ] [ <path name> ]"
echo " delete <interface>[:<host-list>] ... <zone>" echo " delete <interface>[:<host-list>] ... <zone>"
@ -1455,6 +1451,7 @@ usage() # $1 = exit status
echo " version [ -a ]" echo " version [ -a ]"
echo " safe-start [ <directory> ]" echo " safe-start [ <directory> ]"
echo " safe-restart [ <directory> ]" echo " safe-restart [ <directory> ]"
echo " upgrade [ -e ] [ -d ] [ -p ] [ -r ] [ -T ] [ -a ] [ <directory> ]"
echo echo
exit $1 exit $1
} }
@ -1745,6 +1742,12 @@ case "$COMMAND" in
shift shift
check_command $@ check_command $@
;; ;;
upgrade)
get_config Yes
shift
g_upgrade=Yes
check_command $@
;;
show|list) show|list)
get_config Yes No Yes get_config Yes No Yes
shift shift

View File

@ -64,10 +64,6 @@
<arg><option>-T</option></arg> <arg><option>-T</option></arg>
<arg><option>-u</option></arg>
<arg><option>-a</option></arg>
<arg><replaceable>directory</replaceable></arg> <arg><replaceable>directory</replaceable></arg>
</cmdsynopsis> </cmdsynopsis>
@ -623,6 +619,30 @@
<arg><replaceable>timeout</replaceable></arg> <arg><replaceable>timeout</replaceable></arg>
</cmdsynopsis> </cmdsynopsis>
<cmdsynopsis>
<command>shorewall</command>
<arg choice="opt"><option>trace</option>|<option>debug</option></arg>
<arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>upgrade</option></arg>
<arg><option>-e</option></arg>
<arg><option>-d</option></arg>
<arg><option>-p</option></arg>
<arg><option>-r</option></arg>
<arg><option>-T</option></arg>
<arg><option>-a</option></arg>
<arg><replaceable>directory</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis> <cmdsynopsis>
<command>shorewall</command> <command>shorewall</command>
@ -1540,6 +1560,28 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><emphasis role="bold">upgrade</emphasis></term>
<listitem>
<para>Added in Shorewall 4.4.21 and causes the compiler to validate
the configuration and then upgrade
<filename>/etc/shorewall/shorewall.conf</filename>. The upgrade will
add new options with their default values and will move deprecated
options with non-defaults to a deprecated options section at the
bottom of the file. Your existing
<filename>shorewall.conf</filename> file is renamed
<filename>shorewall.conf.bak.</filename></para>
<para>The <option>-a</option> option causes the upgraded
<filename>shorewall.conf</filename> file to be annotated with
documentation.</para>
<para>For a description of the other options, see the <emphasis
role="bold">check</emphasis> command above.</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><emphasis role="bold">version</emphasis></term> <term><emphasis role="bold">version</emphasis></term>

View File

@ -48,8 +48,6 @@
<arg><option>-T</option></arg> <arg><option>-T</option></arg>
<arg><option>-u</option><arg><option>-a</option></arg></arg>
<arg><replaceable>directory</replaceable></arg> <arg><replaceable>directory</replaceable></arg>
</cmdsynopsis> </cmdsynopsis>
@ -506,6 +504,30 @@
<arg><replaceable>timeout</replaceable></arg> <arg><replaceable>timeout</replaceable></arg>
</cmdsynopsis> </cmdsynopsis>
<cmdsynopsis>
<command>shorewall6</command>
<arg choice="opt"><option>trace</option>|<option>debug</option></arg>
<arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>upgrade</option></arg>
<arg><option>-e</option></arg>
<arg><option>-d</option></arg>
<arg><option>-p</option></arg>
<arg><option>-r</option></arg>
<arg><option>-T</option></arg>
<arg><option>-a</option></arg>
<arg><replaceable>directory</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis> <cmdsynopsis>
<command>shorewall6</command> <command>shorewall6</command>
@ -602,20 +624,6 @@
<para>The <option>-T</option> option was added in Shorewall 4.4.20 <para>The <option>-T</option> option was added in Shorewall 4.4.20
and causes a Perl stack trace to be included with each and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para> compiler-generated error and warning message.</para>
<para>The <option>-u</option> option was added in Shorewall 4.4.21
and causes the compiler to upgrade
<filename>/etc/shorewall6/shorewall6.conf</filename>. The upgrade
will add new options with their default values and will move
deprecated options with non-defaults to a deprecated options section
at the bottom of the file. Your existing
<filename>shorewall6.conf</filename> file is renamed
<filename>shorewall6.conf.bak.</filename></para>
<para>The <option>-a</option> option was added in Shorewall 4.4.21
and is only meaningful when used with <option>-u</option>. It causes
the upgraded <filename>shorewall6.conf</filename> file to be
annotated with documentation.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -1293,6 +1301,28 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><emphasis role="bold">upgrade</emphasis></term>
<listitem>
<para>Added in Shorewall 4.4.21 and causes the compiler to validate
the configuration and then upgrade
<filename>/etc/shorewall6/shorewall6.conf</filename>. The upgrade
will add new options with their default values and will move
deprecated options with non-defaults to a deprecated options section
at the bottom of the file. Your existing
<filename>shorewall6.conf</filename> file is renamed
<filename>shorewall6.conf.bak.</filename></para>
<para>The <option>-a</option> option causes the upgraded
<filename>shorewall6.conf</filename> file to be annotated with
documentation.</para>
<para>For a description of the other options, see the <emphasis
role="bold">check</emphasis> command above.</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><emphasis role="bold">version</emphasis></term> <term><emphasis role="bold">version</emphasis></term>