Implement DEFAULT_PAGER in shorewallrc

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-09-21 10:20:48 -07:00
parent afc212495f
commit e81a4788c6
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10
17 changed files with 29 additions and 5 deletions

View File

@ -235,7 +235,8 @@ for on in \
SPARSE \ SPARSE \
ANNOTATED \ ANNOTATED \
VARLIB \ VARLIB \
VARDIR VARDIR \
DEFAULT_PAGER
do do
echo "$on=${options[${on}]}" echo "$on=${options[${on}]}"
echo "$on=${options[${on}]}" >> shorewallrc echo "$on=${options[${on}]}" >> shorewallrc

View File

@ -209,7 +209,8 @@ for ( qw/ HOST
SPARSE SPARSE
ANNOTATED ANNOTATED
VARLIB VARLIB
VARDIR / ) { VARDIR
DEFAULT_PAGER / ) {
my $val = $options{$_} || ''; my $val = $options{$_} || '';

View File

@ -3898,6 +3898,8 @@ get_config() {
g_loopback=$(find_loopback_interfaces) g_loopback=$(find_loopback_interfaces)
[ -n "$PAGER" ] || PAGER=$DEFAULT_PAGER
if [ -n "$PAGER" -a -t 1 ]; then if [ -n "$PAGER" -a -t 1 ]; then
case $PAGER in case $PAGER in
/*) /*)
@ -3905,7 +3907,7 @@ get_config() {
[ -f "$g_pager" ] || fatal_error "PAGER=$PAGER does not exist" [ -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" [ -n "$g_pager" ] || fatal_error "PAGER=$PAGER does not exist"
;; ;;
esac esac

View File

@ -19,3 +19,4 @@ SERVICEFILE= #Unused on OS X
SYSCONFDIR= #Unused on OS X SYSCONFDIR= #Unused on OS X
SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR. SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR.
VARLIB=/var/lib #Unused on OS X VARLIB=/var/lib #Unused on OS X
DEFAULT_PAGER= #Pager to use if none specified in shorewall[6].conf

View File

@ -20,3 +20,4 @@ SERVICEFILE= #Name of the file to install in $SYSTEMD.
SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
VARLIB=/var/lib #Directory where product variable data is stored. VARLIB=/var/lib #Directory where product variable data is stored.
VARDIR=${VARLIB}/$PRODUCT #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

View File

@ -19,3 +19,4 @@ SERVICEFILE= #Unused on Cygwin
SYSCONFDIR= #Unused on Cygwin SYSCONFDIR= #Unused on Cygwin
SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR. SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR.
VARLIB=/var/lib #Unused on Cygwin VARLIB=/var/lib #Unused on Cygwin
DEFAULT_PAGER= #Pager to use if none specified in shorewall[6].conf

View File

@ -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 SPARSE=Yes #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
VARLIB=/var/lib #Directory where product variable data is stored. VARLIB=/var/lib #Directory where product variable data is stored.
VARDIR=${VARLIB}/$PRODUCT #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

View File

@ -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 SPARSE=Yes #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
VARLIB=/var/lib #Directory where product variable data is stored. VARLIB=/var/lib #Directory where product variable data is stored.
VARDIR=${VARLIB}/$PRODUCT #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

View File

@ -21,3 +21,4 @@ SYSCONFDIR= #Directory where SysV init parameter fil
SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
VARLIB=/var/lib #Directory where product variable data is stored. VARLIB=/var/lib #Directory where product variable data is stored.
VARDIR=${VARLIB}/$PRODUCT #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

View File

@ -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 SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
VARLIB=/lib #Directory where product variable data is stored. VARLIB=/lib #Directory where product variable data is stored.
VARDIR=${VARLIB}/$PRODUCT #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

View File

@ -21,3 +21,4 @@ SYSCONFDIR=/etc/sysconfig/ #Directory where SysV init parameter fil
SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
VARLIB=/var/lib #Directory where product variable data is stored. VARLIB=/var/lib #Directory where product variable data is stored.
VARDIR=${VARLIB}/$PRODUCT #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

View File

@ -22,3 +22,4 @@ SYSCONFDIR= #Name of the directory where SysV ini
ANNOTATED= #If non-empty, install annotated configuration files ANNOTATED= #If non-empty, install annotated configuration files
VARLIB=/var/lib #Directory where product variable data is stored. VARLIB=/var/lib #Directory where product variable data is stored.
VARDIR=${VARLIB}/$PRODUCT #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

View File

@ -21,3 +21,4 @@ SYSCONFDIR=/etc/sysconfig/ #Directory where SysV init
SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
VARLIB=/var/lib #Directory where persistent product data is stored. VARLIB=/var/lib #Directory where persistent product data is stored.
VARDIR=${VARLIB}/$PRODUCT #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

View File

@ -3855,6 +3855,8 @@ sub process_shorewallrc( $$ ) {
} elsif ( supplied $shorewallrc{VARLIB} ) { } elsif ( supplied $shorewallrc{VARLIB} ) {
$shorewallrc{VARDIR} = "$shorewallrc{VARLIB}/$product"; $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( 'USE_DEFAULT_RT', 'No' );
update_default( 'EXPORTMODULES', 'No' ); update_default( 'EXPORTMODULES', 'No' );
update_default( 'RESTART', 'reload' ); update_default( 'RESTART', 'reload' );
update_default( 'PAGER', '' ); update_default( 'PAGER', $shorewallrc1{DEFAULT_PAGER} );
my $fn; my $fn;

View File

@ -316,6 +316,8 @@ get_config() {
g_loopback=$(find_loopback_interfaces) g_loopback=$(find_loopback_interfaces)
[ -n "$PAGER" ] || PAGER=$DEFAULT_PAGER
if [ -n "$PAGER" -a -t 1 ]; then if [ -n "$PAGER" -a -t 1 ]; then
case $PAGER in case $PAGER in
/*) /*)
@ -323,7 +325,7 @@ get_config() {
[ -f "$g_pager" ] || fatal_error "PAGER $PAGER does not exist" [ -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" [ -n "$g_pager" ] || fatal_error "PAGER $PAGER not found"
;; ;;
esac esac

View File

@ -2009,6 +2009,9 @@ LOG:info:,bar net fw</programlisting>
When PAGER is given, the output of verbose <command>status</command> When PAGER is given, the output of verbose <command>status</command>
commands and the <command>dump</command> command are piped through commands and the <command>dump</command> command are piped through
the named program when the output file is a terminal.</para> the named program when the output file is a terminal.</para>
<para>Beginning with Shorewall 5.0.12, the default value of this
option is the DEFAULT_PAGER setting in shorewallrc.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -1734,6 +1734,9 @@ LOG:info:,bar net fw</programlisting>
When PAGER is given, the output of verbose <command>status</command> When PAGER is given, the output of verbose <command>status</command>
commands and the <command>dump</command> command are piped through commands and the <command>dump</command> command are piped through
the named program when the output file is a terminal.</para> the named program when the output file is a terminal.</para>
<para>Beginning with Shorewall 5.0.12, the default value of this
option is the DEFAULT_PAGER setting in shorewallrc.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>