diff --git a/Shorewall-core/configure b/Shorewall-core/configure index adb4f1bad..e5d9b9a0e 100755 --- a/Shorewall-core/configure +++ b/Shorewall-core/configure @@ -235,7 +235,8 @@ for on in \ SPARSE \ ANNOTATED \ VARLIB \ - VARDIR + VARDIR \ + DEFAULT_PAGER do echo "$on=${options[${on}]}" echo "$on=${options[${on}]}" >> shorewallrc diff --git a/Shorewall-core/configure.pl b/Shorewall-core/configure.pl index 387d07b9c..7b4b62057 100755 --- a/Shorewall-core/configure.pl +++ b/Shorewall-core/configure.pl @@ -209,7 +209,8 @@ for ( qw/ HOST SPARSE ANNOTATED VARLIB - VARDIR / ) { + VARDIR + DEFAULT_PAGER / ) { my $val = $options{$_} || ''; diff --git a/Shorewall-core/lib.cli b/Shorewall-core/lib.cli index 5015936b4..4b3e0389f 100644 --- a/Shorewall-core/lib.cli +++ b/Shorewall-core/lib.cli @@ -3898,6 +3898,8 @@ get_config() { g_loopback=$(find_loopback_interfaces) + [ -n "$PAGER" ] || PAGER=$DEFAULT_PAGER + if [ -n "$PAGER" -a -t 1 ]; then case $PAGER in /*) @@ -3905,7 +3907,7 @@ get_config() { [ -f "$g_pager" ] || fatal_error "PAGER=$PAGER does not exist" ;; *) - g_pager=$(mywhich pager 2> /dev/null) + g_pager=$(mywhich $PAGER 2> /dev/null) [ -n "$g_pager" ] || fatal_error "PAGER=$PAGER does not exist" ;; esac diff --git a/Shorewall-core/shorewallrc.apple b/Shorewall-core/shorewallrc.apple index 92ea711da..fc20486f0 100644 --- a/Shorewall-core/shorewallrc.apple +++ b/Shorewall-core/shorewallrc.apple @@ -19,3 +19,4 @@ SERVICEFILE= #Unused on OS X SYSCONFDIR= #Unused on OS X SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR. VARLIB=/var/lib #Unused on OS X +DEFAULT_PAGER= #Pager to use if none specified in shorewall[6].conf diff --git a/Shorewall-core/shorewallrc.archlinux b/Shorewall-core/shorewallrc.archlinux index d0a2541cb..68a694410 100644 --- a/Shorewall-core/shorewallrc.archlinux +++ b/Shorewall-core/shorewallrc.archlinux @@ -20,3 +20,4 @@ SERVICEFILE= #Name of the file to install in $SYSTEMD. SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR VARLIB=/var/lib #Directory where product variable data is stored. VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored. +DEFAULT_PAGER= #Pager to use if none specified in shorewall[6].conf diff --git a/Shorewall-core/shorewallrc.cygwin b/Shorewall-core/shorewallrc.cygwin index 4709387f6..371c135ea 100644 --- a/Shorewall-core/shorewallrc.cygwin +++ b/Shorewall-core/shorewallrc.cygwin @@ -19,3 +19,4 @@ SERVICEFILE= #Unused on Cygwin SYSCONFDIR= #Unused on Cygwin SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR. VARLIB=/var/lib #Unused on Cygwin +DEFAULT_PAGER= #Pager to use if none specified in shorewall[6].conf diff --git a/Shorewall-core/shorewallrc.debian.systemd b/Shorewall-core/shorewallrc.debian.systemd index 61fa53c57..184573101 100644 --- a/Shorewall-core/shorewallrc.debian.systemd +++ b/Shorewall-core/shorewallrc.debian.systemd @@ -21,3 +21,4 @@ SERVICEDIR=/lib/systemd/system #Directory where .service files are installed (s SPARSE=Yes #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR VARLIB=/var/lib #Directory where product variable data is stored. VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored. +DEFAULT_PAGER=/usr/bin/less #Pager to use if none specified in shorewall[6].conf diff --git a/Shorewall-core/shorewallrc.debian.sysvinit b/Shorewall-core/shorewallrc.debian.sysvinit index 0bd9e5a48..9396e9fc8 100644 --- a/Shorewall-core/shorewallrc.debian.sysvinit +++ b/Shorewall-core/shorewallrc.debian.sysvinit @@ -21,3 +21,4 @@ SERVICEDIR= #Directory where .service files are installed (systems running sy SPARSE=Yes #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR VARLIB=/var/lib #Directory where product variable data is stored. VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored. +DEFAULT_PAGER=/usr/bin/less #Pager to use if none specified in shorewall[6].conf diff --git a/Shorewall-core/shorewallrc.default b/Shorewall-core/shorewallrc.default index 588f04f32..70395ed2f 100644 --- a/Shorewall-core/shorewallrc.default +++ b/Shorewall-core/shorewallrc.default @@ -21,3 +21,4 @@ SYSCONFDIR= #Directory where SysV init parameter fil SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR VARLIB=/var/lib #Directory where product variable data is stored. VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored. +DEFAULT_PAGER= #Pager to use if none specified in shorewall[6].conf diff --git a/Shorewall-core/shorewallrc.openwrt b/Shorewall-core/shorewallrc.openwrt index 7149aeac4..4c66f357b 100644 --- a/Shorewall-core/shorewallrc.openwrt +++ b/Shorewall-core/shorewallrc.openwrt @@ -21,3 +21,4 @@ SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.se SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR VARLIB=/lib #Directory where product variable data is stored. VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored. +DEFAULT_PAGER= #Pager to use if none specified in shorewall[6].conf diff --git a/Shorewall-core/shorewallrc.redhat b/Shorewall-core/shorewallrc.redhat index 69e3a21d2..122891c21 100644 --- a/Shorewall-core/shorewallrc.redhat +++ b/Shorewall-core/shorewallrc.redhat @@ -21,3 +21,4 @@ SYSCONFDIR=/etc/sysconfig/ #Directory where SysV init parameter fil SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR VARLIB=/var/lib #Directory where product variable data is stored. VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored. +DEFAULT_PAGER= #Pager to use if none specified in shorewall[6].conf diff --git a/Shorewall-core/shorewallrc.slackware b/Shorewall-core/shorewallrc.slackware index 7165efade..a52bf8233 100644 --- a/Shorewall-core/shorewallrc.slackware +++ b/Shorewall-core/shorewallrc.slackware @@ -22,3 +22,4 @@ SYSCONFDIR= #Name of the directory where SysV ini ANNOTATED= #If non-empty, install annotated configuration files VARLIB=/var/lib #Directory where product variable data is stored. VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored. +DEFAULT_PAGER= #Pager to use if none specified in shorewall[6].conf diff --git a/Shorewall-core/shorewallrc.suse b/Shorewall-core/shorewallrc.suse index 9e0b45b9b..e529f3d12 100644 --- a/Shorewall-core/shorewallrc.suse +++ b/Shorewall-core/shorewallrc.suse @@ -21,3 +21,4 @@ SYSCONFDIR=/etc/sysconfig/ #Directory where SysV init SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR VARLIB=/var/lib #Directory where persistent product data is stored. VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored. +DEFAULT_PAGER= #Pager to use if none specified in shorewall[6].conf diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index a485e85a2..f4a5db690 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -3855,6 +3855,8 @@ sub process_shorewallrc( $$ ) { } elsif ( supplied $shorewallrc{VARLIB} ) { $shorewallrc{VARDIR} = "$shorewallrc{VARLIB}/$product"; } + + $shorewallrc{DEFAULT_PAGER} = '' unless supplied $shorewallrc{DEFAULT_PAGER}; } # @@ -5228,7 +5230,7 @@ sub update_config_file( $ ) { update_default( 'USE_DEFAULT_RT', 'No' ); update_default( 'EXPORTMODULES', 'No' ); update_default( 'RESTART', 'reload' ); - update_default( 'PAGER', '' ); + update_default( 'PAGER', $shorewallrc1{DEFAULT_PAGER} ); my $fn; diff --git a/Shorewall/lib.cli-std b/Shorewall/lib.cli-std index 280f773bc..8cc91b555 100644 --- a/Shorewall/lib.cli-std +++ b/Shorewall/lib.cli-std @@ -316,6 +316,8 @@ get_config() { g_loopback=$(find_loopback_interfaces) + [ -n "$PAGER" ] || PAGER=$DEFAULT_PAGER + if [ -n "$PAGER" -a -t 1 ]; then case $PAGER in /*) @@ -323,7 +325,7 @@ get_config() { [ -f "$g_pager" ] || fatal_error "PAGER $PAGER does not exist" ;; *) - g_pager=$(mywhich pager 2> /dev/null) + g_pager=$(mywhich $PAGER 2> /dev/null) [ -n "$g_pager" ] || fatal_error "PAGER $PAGER not found" ;; esac diff --git a/Shorewall/manpages/shorewall.conf.xml b/Shorewall/manpages/shorewall.conf.xml index a7dab5393..c007f24c3 100644 --- a/Shorewall/manpages/shorewall.conf.xml +++ b/Shorewall/manpages/shorewall.conf.xml @@ -2009,6 +2009,9 @@ LOG:info:,bar net fw When PAGER is given, the output of verbose status commands and the dump command are piped through the named program when the output file is a terminal. + + Beginning with Shorewall 5.0.12, the default value of this + option is the DEFAULT_PAGER setting in shorewallrc. diff --git a/Shorewall6/manpages/shorewall6.conf.xml b/Shorewall6/manpages/shorewall6.conf.xml index 2789b656c..b9ac4b0ce 100644 --- a/Shorewall6/manpages/shorewall6.conf.xml +++ b/Shorewall6/manpages/shorewall6.conf.xml @@ -1734,6 +1734,9 @@ LOG:info:,bar net fw When PAGER is given, the output of verbose status commands and the dump command are piped through the named program when the output file is a terminal. + + Beginning with Shorewall 5.0.12, the default value of this + option is the DEFAULT_PAGER setting in shorewallrc.