Implement -p option to disable PAGER

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-11-17 10:58:10 -08:00
parent ab9f340c55
commit 9eb390403b
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10
2 changed files with 42 additions and 28 deletions

View File

@ -1161,7 +1161,11 @@ show_macros() {
done
}
show_a_macro() {
echo "Shorewall $SHOREWALL_VERSION Macro $1 at $g_hostname - $(date)"
cat ${directory}/macro.$1
}
#
# Show Command Executor
#
@ -3992,6 +3996,7 @@ get_config() {
g_loopback=$(find_loopback_interfaces)
if [ -z "$g_nopager" ]; then
[ -n "$PAGER" ] || PAGER=$DEFAULT_PAGER
if [ -n "$PAGER" -a -t 1 ]; then
@ -4010,6 +4015,7 @@ get_config() {
g_pager="| $g_pager"
fi
fi
if [ -n "$DYNAMIC_BLACKLIST" ]; then
setup_dbl
@ -4357,6 +4363,7 @@ shorewall_cli() {
g_loopback=
g_compiled=
g_pager=
g_nopager=
g_blacklistipset=
g_disconnect=
@ -4453,6 +4460,11 @@ shorewall_cli() {
g_timestamp=Yes
option=${option#t}
;;
p*)
g_nopager=Yes
option=${option#p}
;;
-)
finished=1
option=

View File

@ -318,6 +318,7 @@ get_config() {
[ -n "$PAGER" ] || PAGER=$DEFAULT_PAGER
if [ -z "$g_nopager" ]; then
if [ -n "$PAGER" -a -t 1 ]; then
case $PAGER in
/*)
@ -334,6 +335,7 @@ get_config() {
g_pager="| $g_pager"
fi
fi
if [ -n "$DYNAMIC_BLACKLIST" ]; then
setup_dbl