mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 06:10:42 +01:00
Implement DEFAULT_PAGER in shorewallrc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
afc212495f
commit
e81a4788c6
3
Shorewall-core/configure
vendored
3
Shorewall-core/configure
vendored
@ -235,7 +235,8 @@ for on in \
|
||||
SPARSE \
|
||||
ANNOTATED \
|
||||
VARLIB \
|
||||
VARDIR
|
||||
VARDIR \
|
||||
DEFAULT_PAGER
|
||||
do
|
||||
echo "$on=${options[${on}]}"
|
||||
echo "$on=${options[${on}]}" >> shorewallrc
|
||||
|
@ -209,7 +209,8 @@ for ( qw/ HOST
|
||||
SPARSE
|
||||
ANNOTATED
|
||||
VARLIB
|
||||
VARDIR / ) {
|
||||
VARDIR
|
||||
DEFAULT_PAGER / ) {
|
||||
|
||||
my $val = $options{$_} || '';
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -2009,6 +2009,9 @@ LOG:info:,bar net fw</programlisting>
|
||||
When PAGER is given, the output of verbose <command>status</command>
|
||||
commands and the <command>dump</command> command are piped through
|
||||
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>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -1734,6 +1734,9 @@ LOG:info:,bar net fw</programlisting>
|
||||
When PAGER is given, the output of verbose <command>status</command>
|
||||
commands and the <command>dump</command> command are piped through
|
||||
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>
|
||||
</varlistentry>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user