Sort the output of 'show capabilities'

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-12-21 11:09:18 -08:00
parent da0261cb91
commit 24c69f9efb

View File

@ -2442,7 +2442,7 @@ determine_capabilities() {
esac
}
report_capabilities() {
report_capabilities_unsorted() {
report_capability() # $1 = Capability Description , $2 Capability Setting (if any)
{
local setting
@ -2453,8 +2453,6 @@ report_capabilities() {
echo " " $1: $setting
}
if [ $VERBOSITY -gt 1 ]; then
echo "$g_product has detected the following iptables/netfilter capabilities:"
report_capability "NAT (NAT_ENABLED)" $NAT_ENABLED
report_capability "Packet Mangling (MANGLE_ENABLED)" $MANGLE_ENABLED
report_capability "Multi-port Match (MULTIPORT)" $MULTIPORT
@ -2554,21 +2552,25 @@ report_capabilities() {
echo " Kernel Version (KERNELVERSION): $KERNELVERSION"
echo " Capabilities Version (CAPVERSION): $CAPVERSION"
}
report_capabilities() {
if [ $VERBOSITY -gt 1 ]; then
echo "$g_product has detected the following iptables/netfilter capabilities:"
report_capabilities_unsorted | sort
fi
[ -n "$PKTTYPE" ] || USEPKTTYPE=
}
report_capabilities1() {
report_capabilities_unsorted1() {
report_capability1() # $1 = Capability
{
eval echo $1=\$$1
}
echo "#"
echo "# $g_product $SHOREWALL_VERSION detected the following iptables/netfilter capabilities - $(date)"
echo "#"
report_capability1 NAT_ENABLED
report_capability1 MANGLE_ENABLED
report_capability1 MULTIPORT
@ -2660,6 +2662,13 @@ report_capabilities1() {
echo KERNELVERSION=$KERNELVERSION
}
report_capabilities1() {
echo "#"
echo "# $g_product $SHOREWALL_VERSION detected the following iptables/netfilter capabilities - $(date)"
echo "#"
report_capabilities_unsorted1 | sort
}
show_status() {
if product_is_started ; then
echo "$g_product is running"