diff options
36 files changed, 488 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..27e36d6 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,12 @@ +defaultdir = /etc/default +default_DATA = etc/default/vyatta +completiondir = /etc/bash_completion.d +completion_DATA = etc/bash_completion.d/vyatta-op +opdir = $(datadir)/vyatta-op/templates + +cpiop = find . ! -regex '\(.*~\|.*\.bak\|.*\.swp\|.*\#.*\#\)' -print0 | \ + cpio -0pd + +install-exec-hook: + mkdir -p $(DESTDIR)$(opdir) + cd op-templates; $(cpiop) $(DESTDIR)$(opdir) diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..631597b --- /dev/null +++ b/configure.ac @@ -0,0 +1,30 @@ +# Process this file with autoconf to produce a configure script. +AC_PREREQ(2.59) + +m4_define([VERSION_ID], [m4_esyscmd([ + if test -f .version ; then + head -n 1 .version | tr -d \\n + else + echo -n 2.4 + fi])]) +AC_INIT([vyatta-op], VERSION_ID, [vyatta-support@vyatta.com]) + +test -n "$VYATTA_VERSION" || VYATTA_VERSION=$PACKAGE_VERSION + +AC_CONFIG_AUX_DIR([config]) +AM_INIT_AUTOMAKE([gnu no-dist-gzip dist-bzip2 subdir-objects]) +AC_PREFIX_DEFAULT([/opt/vyatta]) + +AC_ARG_ENABLE([nostrip], + AC_HELP_STRING([--enable-nostrip], + [include -nostrip option during packaging]), + [NOSTRIP=-nostrip], [NOSTRIP=]) + +AC_CONFIG_FILES( + [Makefile] + [etc/default/vyatta]) + +AC_SUBST(NOSTRIP) + +AC_OUTPUT + diff --git a/etc/bash_completion.d/vyatta-op b/etc/bash_completion.d/vyatta-op new file mode 100644 index 0000000..8e4d79f --- /dev/null +++ b/etc/bash_completion.d/vyatta-op @@ -0,0 +1,196 @@ +#!/bin/bash +# +# **** License **** +# Version: VPL 1.0 +# +# The contents of this file are subject to the Vyatta Public License +# Version 1.0 ("License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.vyatta.com/vpl +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# This code was originally developed by Vyatta, Inc. +# Portions created by Vyatta are Copyright (C) 2006, 2007 Vyatta, Inc. +# All Rights Reserved. +# +# Author: Tom Grennan +# Date: 2007 +# Description: setup bash completion for Vyatta operational commands +# +# **** End License **** + +# first set vars per args of the "source ...vyatta-op VAR=FOO" +_vyatta_extglob=$(shopt -p extglob) +shopt -s extglob +for e ; do + if [[ $e == *=* ]] ; then + eval $e + fi +done +eval $_vyatta_extglob +unset _vyatta_extglob + +test -f /etc/default/vyatta && source /etc/default/vyatta + +: ${vyatta_op_templates:=/opt/vyatta/share/vyatta-op/templates} + +declare -a _vyatta_op_comp_words +declare -a _vyatta_op_allowed +declare _vyatta_op_node_def +declare -x OFR_PAGER +declare -x OFR_DEFAULT_PAGER + +_vyatta_op_get_node_def_field () +{ + local file=$1 field=$2 + + sed -n '/^'"$field"':/,$ { +# strip field name and hold rest of line + s/[a-z]*: *// + h + :b +# at EOF, print hold buffer and quit + $ { x; p; q } +# input next line + n +# if start of another field def, print hold buf and quit + /^[a-z]*:/ { x; p; q } +# add to hold buf and branch to input next line + H + bb + }' $file +} + +_vyatta_op_set_allowed_subdirs () +{ + local dir=$1 + + _vyatta_op_allowed=( + $( find ${vyatta_op_templates}$1/* -maxdepth 0 -type d -printf %f\\n )) +} + +_vyatta_op_set_allowed () +{ + local nullglob=$( shopt -p nullglob ) + shopt -s nullglob + _vyatta_op_allowed=($( + eval "$( _vyatta_op_get_node_def_field $_vyatta_op_node_def allowed )" )) + eval $nullglob +} + +_vyatta_op_is_allowed () +{ + local arg=$1 allowed + + # return immediately if nothing allowed + [ ${#_vyatta_op_allowed[@]} -ne 0 ] || return + # -- is wildcard that allows anything + [ ${_vyatta_op_allowed[0]} == -- ] && return + for allowed in ${_vyatta_op_allowed[@]} ; do + [ "$arg" == $allowed ] && return + done + false +} + +_vyatta_op_scan () +{ + local -a argv=( $@ ) + local -i i=0 argc=$# + local arg dir node_def + local -a allowed + + while true ; do + if [ -d ${vyatta_op_templates}${dir}/node.tag ] ; then + node_def=${vyatta_op_templates}${dir}/node.tag/node.def + if [ ! -f $node_def ] ; then + echo -e \\ninvalid template, missing: >&2 + echo -e \\t$_vyatta_op_node_def >&2 + return 1 + fi + _vyatta_op_node_def=$node_def + _vyatta_op_set_allowed $@ + [[ $i -eq $argc ]] && return 0 + arg=${argv[i]}; let i++ + if _vyatta_op_is_allowed $arg ; then + dir+=/node.tag + _vyatta_op_set_allowed_subdirs $dir + continue + elif [[ $i -ne $argc ]] ; then + echo -e \\ninvalid option: $arg >&2 + return 1 + fi + fi + [[ $i -eq $argc ]] && return 0 + arg=${argv[i]}; let i++ + node_def=${vyatta_op_templates}${dir}/${arg}/node.def + if [ -f $node_def ] ; then + dir+=/${arg} + _vyatta_op_node_def=$node_def + _vyatta_op_set_allowed_subdirs $dir + continue + elif [[ $i -ne $argc ]] ; then + echo -e \\ninvalid template, missing node.\{def,tag\} >&2 + echo -e \\t${vyatta_op_templates}$dir/$arg >&2 + return 1 + fi + done +} + +_vyatta_op_expand () +{ + local cur=${COMP_WORDS[COMP_CWORD]} + + if _vyatta_op_scan "${COMP_WORDS[@]}" ; then + COMPREPLY=($( compgen -W "${_vyatta_op_allowed[*]}" -- $cur )) + _vyatta_op_comp_words=( ${COMP_WORDS[@]} ) + fi +} + +_vyatta_op_help () +{ + local help + + if _vyatta_op_scan ${_vyatta_op_comp_words[@]} ; then + eval help=$( _vyatta_op_get_node_def_field $_vyatta_op_node_def help ) + echo -e "$help" + fi +} + +_vyatta_op_run () +{ + if _vyatta_op_scan $@ ; then + eval "$( _vyatta_op_get_node_def_field $_vyatta_op_node_def run )" + fi +} + +for p in $PAGER pager most less more cat ; do + if type -t $p &>/dev/null ; then + OFR_DEFAULT_PAGER=$p + break + fi +done + +: ${OFR_PAGER:=${OFR_DEFAULT_PAGER}} + +if [[ -d $vyatta_op_templates ]] +then + for xd in ${vyatta_op_templates}/!(README|*~|*.bak|*.swp|\#*\#) ; do + if [ -d $xd ] ; then + cmd=${xd##*/} + complete -F _vyatta_op_expand -o nospace $cmd + eval alias $cmd=\'_vyatta_op_run $cmd\' + fi + done +fi + +bind -x '"\e?": _vyatta_op_help' + +shopt -s histverify + +### Local Variables: +### mode: shell-script +### End: diff --git a/etc/default/vyatta.in b/etc/default/vyatta.in new file mode 100644 index 0000000..be92ada --- /dev/null +++ b/etc/default/vyatta.in @@ -0,0 +1,162 @@ +#!/bin/bash + +# declare configred Vyatta shell environment variables + +# first set vars per args of the "source /etc/default/vyatta VAR=FOO" +_vyatta_extglob=$(shopt -p extglob) +shopt -s extglob +for arg ; do + [[ $arg == *=* ]] && \ + eval declare -x $arg +done +eval $_vyatta_extglob +unset _vyatta_extglob + +{ + # These declarations must go within braces in order to be able to silence + # readonly variable errors. + + for var in prefix exec_prefix datarootdir ; do + eval test -n \"\$$var\" \&\& _vyatta_save_$var=\$$var + done + + prefix=@prefix@ + exec_prefix=@exec_prefix@ + datarootdir=@datarootdir@ + + if test -z "$vyatta_prefix" ; then + if test -n "@prefix@" ; then + declare -x -r vyatta_prefix=@prefix@ + else + declare -x -r vyatta_prefix=$vyatta_prefix + fi + fi + if test -z "$vyatta_exec_prefix" ; then + if test -n "@exec_prefix@" ; then + declare -x -r vyatta_prefix=@exec_prefix@ + else + declare -x -r vyatta_prefix=$vyatta_prefix + fi + fi + if test -z "$vyatta_datarootdir" ; then + if test -n "@datarootdir@" ; then + declare -x -r vyatta_datarootdir=@datarootdir@ + else + declare -x -r vyatta_datarootdir=$vyatta_prefix/share + fi + fi + if test -z "$vyatta_bindir" ; then + if test -n "@bindir@" ; then + declare -x -r vyatta_bindir=@bindir@ + else + declare -x -r vyatta_bindir=$vyatta_exec_prefix/bin + fi + fi + if test -z "$vyatta_sbindir" ; then + if test -n "@sbindir@" ; then + declare -x -r vyatta_sbindir=@sbindir@ + else + declare -x -r vyatta_sbindir=$vyatta_exec_prefix/sbin + fi + fi + if test -z "$vyatta_libdir" ; then + if test -n "@libdir@" ; then + declare -x -r vyatta_libdir=@libdir@ + else + declare -x -r vyatta_libdir=$vyatta_exec_prefix/lib + fi + fi + if test -z "$vyatta_libexecdir" ; then + if test -n "@libexecdir@" ; then + declare -x -r vyatta_libexecdir=@libexecdir@ + else + declare -x -r vyatta_libexecdir=$vyatta_exec_prefix/libexec + fi + fi + if test -z "$vyatta_datadir" ; then + if test -n "@datadir@" ; then + declare -x -r vyatta_datadir=@datadir@ + else + declare -x -r vyatta_datadir=$vyatta_datarootdir + fi + fi + if test -z "$vyatta_htmldir" ; then + if test -n "@htmldir@" ; then + declare -x -r vyatta_htmldir=@htmldir@ + else + declare -x -r vyatta_htmldir=$vyatta_datarootdir/html + fi + fi + if test -z "$vyatta_infodir" ; then + if test -n "@infodir@" ; then + declare -x -r vyatta_infodir=@infodir@ + else + declare -x -r vyatta_infodir=$vyatta_datarootdir/info + fi + fi + if test -z "$vyatta_mandir" ; then + if test -n "@mandir@" ; then + declare -x -r vyatta_htmldir=@mandir@ + else + declare -x -r vyatta_htmldir=$vyatta_datarootdir/man + fi + fi + if test -z "$vyatta_localedir" ; then + if test -n "@localedir@" ; then + declare -x -r vyatta_localedir=@localedir@ + else + declare -x -r vyatta_localedir=$vyatta_datarootdir/locale + fi + fi + if test -z "$vyatta_localstatedir" ; then + if test -n "@localstatedir@" ; then + declare -x -r vyatta_localstatedir=@localstatedir@ + else + declare -x -r vyatta_localstatedir=$vyatta_prefix/var + fi + fi + if test -z "$vyatta_sharedstatedir" ; then + if test -n "@sharedstatedir@" ; then + declare -x -r vyatta_sharedstatedir=@sharedstatedir@ + else + declare -x -r vyatta_sharedstatedir=$vyatta_prefix/com + fi + fi + if test -z "$vyatta_sysconfdir" ; then + if test -n "@sysconfdir@" ; then + declare -x -r vyatta_sysconfdir=@sysconfdir@ + else + declare -x -r vyatta_sysconfdir=$vyatta_prefix/etc + fi + fi + + if test -z "$vyatta_op_templates" ; then + declare -x -r vyatta_op_templates=$vyatta_datadir/vyatta-op/templates + fi + if test -z "$vyatta_config_templates" ; then + declare -x -r vyatta_config_templates=$vyatta_datadir/vyatta-config/templates + fi + if test -z "$vyatta_configdir" ; then + declare -x -r vyatta_configdir=$vyatta_prefix/config + fi + + for var in prefix exec_prefix datarootdir ; do + eval test -n \"\$_vyatta_save_$var\" \&\& $var=\$_vyatta_save_$var + done + + +} 2>/dev/null || : + +export VYATTA_ACTIVE_CONFIGURATION_DIR=${vyatta_configdir}/active +export VYATTA_CHANGES_ONLY_DIR=${vyatta_configdir}/tmp/changes_only_$$ +export VYATTA_TEMP_CONFIG_DIR=${vyatta_configdir}/tmp/new_config_$$ +export VYATTA_CONFIG_TMP=${vyatta_configdir}/tmp/tmp_$$ +export VYATTA_CONFIG_TEMPLATE=$vyatta_config_templatesdir +export VYATTA_EDIT_LEVEL=/ +export VYATTA_TEMPLATE_LEVEL=/ +export VYATTA_TAG_NAME=node.tag +export VYATTA_MOD_NAME=.modified + +### Local Variables: +### mode: shell-script +### End: diff --git a/op-templates/configure/node.def b/op-templates/configure/node.def new file mode 100644 index 0000000..09d0e4b --- /dev/null +++ b/op-templates/configure/node.def @@ -0,0 +1,2 @@ +help: "Enter configure mode" +run: export _OFR_CONFIGURE=ok; newgrp quaggavty ; unset _OFR_CONFIGURE diff --git a/op-templates/date/node.def b/op-templates/date/node.def new file mode 100644 index 0000000..0b1187b --- /dev/null +++ b/op-templates/date/node.def @@ -0,0 +1 @@ +help: "Set system date and time" diff --git a/op-templates/date/ntp/node.def b/op-templates/date/ntp/node.def new file mode 100644 index 0000000..9b5fb8b --- /dev/null +++ b/op-templates/date/ntp/node.def @@ -0,0 +1 @@ +help: "Set system date and time using NTP" diff --git a/op-templates/date/ntp/op.tag/node.def b/op-templates/date/ntp/op.tag/node.def new file mode 100644 index 0000000..b958310 --- /dev/null +++ b/op-templates/date/ntp/op.tag/node.def @@ -0,0 +1,3 @@ +type: txt +help: "IP or hostname of NTP server" +run: "sudo ntpdate $3" diff --git a/op-templates/date/op.tag/node.def b/op-templates/date/op.tag/node.def new file mode 100644 index 0000000..01fb6b0 --- /dev/null +++ b/op-templates/date/op.tag/node.def @@ -0,0 +1,2 @@ +help: "Date and time [MMDDhhmm[.ss]YYYY]" +run: sudo date $2 diff --git a/op-templates/show/interfaces/ethernet/node.def b/op-templates/show/interfaces/ethernet/node.def new file mode 100644 index 0000000..9d70e68 --- /dev/null +++ b/op-templates/show/interfaces/ethernet/node.def @@ -0,0 +1,2 @@ +help: "Show ethernet interface information" +run: ${ofr_bindir}/show_interfaces_ethernet diff --git a/op-templates/show/interfaces/ethernet/node.tag/node.def b/op-templates/show/interfaces/ethernet/node.tag/node.def new file mode 100644 index 0000000..df23e1d --- /dev/null +++ b/op-templates/show/interfaces/ethernet/node.tag/node.def @@ -0,0 +1,5 @@ +help: "Show given ethernet interface information" +allowed: local -a array ; + array=( /sys/class/net/{eth,vmnet}* ) ; + echo -n ${array[@]##*/} +run: ${ofr_bindir}/show_interfaces_ethernet $4 diff --git a/op-templates/show/interfaces/ethernet/node.tag/physical/node.def b/op-templates/show/interfaces/ethernet/node.tag/physical/node.def new file mode 100644 index 0000000..9e907d1 --- /dev/null +++ b/op-templates/show/interfaces/ethernet/node.tag/physical/node.def @@ -0,0 +1,3 @@ +help: "Show physical device information of given ethernet interface" +allowed: "" +run: sudo ethtool $4 diff --git a/op-templates/show/interfaces/ethernet/node.tag/vif/node.def b/op-templates/show/interfaces/ethernet/node.tag/vif/node.def new file mode 100644 index 0000000..66490a7 --- /dev/null +++ b/op-templates/show/interfaces/ethernet/node.tag/vif/node.def @@ -0,0 +1,4 @@ +help: "Show given virtual network interface information" +run: tput setaf ${COLOR_RED:-1} ; + echo error: need to supply vif # ; + tput op diff --git a/op-templates/show/interfaces/ethernet/node.tag/vif/node.tag/node.def b/op-templates/show/interfaces/ethernet/node.tag/vif/node.tag/node.def new file mode 100644 index 0000000..6e114d8 --- /dev/null +++ b/op-templates/show/interfaces/ethernet/node.tag/vif/node.tag/node.def @@ -0,0 +1,5 @@ +help: "Show given virtual network interface information" +allowed: for eth in /sys/class/net/eth${4}.* ; do + echo ${eth/*eth${4}./} ; + done +run: ${ofr_bindir}/show_interfaces_ethernet $4 vif $6 diff --git a/op-templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def b/op-templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def new file mode 100644 index 0000000..56f986f --- /dev/null +++ b/op-templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def @@ -0,0 +1,2 @@ +help: "Show given virtual network interface pseudo-physical information" +run: ${ofr_bindir}/show_interfaces_ethernet $4 vif $6 physical diff --git a/op-templates/show/interfaces/loopback/node.def b/op-templates/show/interfaces/loopback/node.def new file mode 100644 index 0000000..45fa122 --- /dev/null +++ b/op-templates/show/interfaces/loopback/node.def @@ -0,0 +1,3 @@ +help: "Show loopback interface information" +run: ${ofr_bindir}/show_interfaces_loopback + diff --git a/op-templates/show/interfaces/loopback/node.tag/node.def b/op-templates/show/interfaces/loopback/node.tag/node.def new file mode 100644 index 0000000..a9d46b8 --- /dev/null +++ b/op-templates/show/interfaces/loopback/node.tag/node.def @@ -0,0 +1,5 @@ +help: "Show given loopback interface information" +allowed: local -a array ; + array=( /sys/class/net/lo* ) ; + echo -n ${array[@]##*/} +run: ${ofr_bindir}/show_interfaces_loopback $4 diff --git a/op-templates/show/interfaces/node.def b/op-templates/show/interfaces/node.def new file mode 100644 index 0000000..e5ca525 --- /dev/null +++ b/op-templates/show/interfaces/node.def @@ -0,0 +1,2 @@ +help: "Show network interface information" +run: ${ofr_bindir}/show_interfaces diff --git a/op-templates/show/interfaces/system/enabled/node.def b/op-templates/show/interfaces/system/enabled/node.def new file mode 100644 index 0000000..b0ca038 --- /dev/null +++ b/op-templates/show/interfaces/system/enabled/node.def @@ -0,0 +1,2 @@ +help: "Show network information of all enabled interfaces" +run: ${ofr_bindir}/show_interfaces_system enabled diff --git a/op-templates/show/interfaces/system/node.def b/op-templates/show/interfaces/system/node.def new file mode 100644 index 0000000..e62ba92 --- /dev/null +++ b/op-templates/show/interfaces/system/node.def @@ -0,0 +1,2 @@ +help: "Show network information of all interfaces" +run: ${ofr_bindir}/show_interfaces_system diff --git a/op-templates/show/interfaces/tunnel/node.def b/op-templates/show/interfaces/tunnel/node.def new file mode 100644 index 0000000..7bebfc2 --- /dev/null +++ b/op-templates/show/interfaces/tunnel/node.def @@ -0,0 +1,3 @@ +help: "Show tunnel interface information" +run: ${ofr_bindir}/show_interfaces_tunnel + diff --git a/op-templates/show/interfaces/tunnel/node.tag/node.def b/op-templates/show/interfaces/tunnel/node.tag/node.def new file mode 100644 index 0000000..b3748e2 --- /dev/null +++ b/op-templates/show/interfaces/tunnel/node.tag/node.def @@ -0,0 +1,5 @@ +help: "Show given tunnel interface information" +allowed: local -a array ; + array=( /sys/class/net/sit* ) ; + echo -n ${array[@]##*/} +run: ${ofr_bindir}/show_interfaces_tunnel $4 diff --git a/op-templates/show/node.def b/op-templates/show/node.def new file mode 100644 index 0000000..73e140d --- /dev/null +++ b/op-templates/show/node.def @@ -0,0 +1 @@ +help: "Show system information" diff --git a/op-templates/show/system/boot-messages/node.def b/op-templates/show/system/boot-messages/node.def new file mode 100644 index 0000000..7180083 --- /dev/null +++ b/op-templates/show/system/boot-messages/node.def @@ -0,0 +1,2 @@ +help: "Show kernel boot messages" +run: ${OFR_PAGER:-cat -s} /var/log/dmes? /dev/null diff --git a/op-templates/show/system/connections/node.def b/op-templates/show/system/connections/node.def new file mode 100644 index 0000000..2341c5f --- /dev/null +++ b/op-templates/show/system/connections/node.def @@ -0,0 +1,2 @@ +help: "Show active network connections on the system" +run: netstat -an diff --git a/op-templates/show/system/kernel-messages/node.def b/op-templates/show/system/kernel-messages/node.def new file mode 100644 index 0000000..6d82b77 --- /dev/null +++ b/op-templates/show/system/kernel-messages/node.def @@ -0,0 +1,2 @@ +help: "Show messages in kernel ring buffer" +run: dmesg | ${OFR_PAGER:-cat -s} diff --git a/op-templates/show/system/memory/node.def b/op-templates/show/system/memory/node.def new file mode 100644 index 0000000..af15820 --- /dev/null +++ b/op-templates/show/system/memory/node.def @@ -0,0 +1,2 @@ +help: "Show system memory usage" +run: "free -ot" diff --git a/op-templates/show/system/node.def b/op-templates/show/system/node.def new file mode 100644 index 0000000..73e140d --- /dev/null +++ b/op-templates/show/system/node.def @@ -0,0 +1 @@ +help: "Show system information" diff --git a/op-templates/show/system/processes/node.def b/op-templates/show/system/processes/node.def new file mode 100644 index 0000000..507ee60 --- /dev/null +++ b/op-templates/show/system/processes/node.def @@ -0,0 +1,2 @@ +help: "Show system processes" +run: ps ax diff --git a/op-templates/show/system/processes/summary/node.def b/op-templates/show/system/processes/summary/node.def new file mode 100644 index 0000000..6cf3e55 --- /dev/null +++ b/op-templates/show/system/processes/summary/node.def @@ -0,0 +1,2 @@ +help: "Show summary of system processes" +run: uptime diff --git a/op-templates/show/system/storage/node.def b/op-templates/show/system/storage/node.def new file mode 100644 index 0000000..7178454 --- /dev/null +++ b/op-templates/show/system/storage/node.def @@ -0,0 +1,2 @@ +help: "Show filesystem usage" +run: df -h -x squashfs diff --git a/op-templates/show/version/node.def b/op-templates/show/version/node.def new file mode 100644 index 0000000..da526d2 --- /dev/null +++ b/op-templates/show/version/node.def @@ -0,0 +1,2 @@ +help: "Show OFR version information" +run: cat $ofr_docdir/*/build.txt /dev/null diff --git a/op-templates/terminal/length/node.def b/op-templates/terminal/length/node.def new file mode 100644 index 0000000..a6aaa85 --- /dev/null +++ b/op-templates/terminal/length/node.def @@ -0,0 +1,12 @@ +help: "Set terminal page length [0 will disable paging]" +run: if [ -n "$3" ] ; then + if [ $3 -eq 0 ] ; then + OFR_PAGER='cat -s' ; + else + export LINES=$3 ; + stty rows $3 ; + fi ; + else + eval $( resize ) ; + fi ; + : ${OFR_PAGER:=${OFR_DEFAULT_PAGER}} diff --git a/op-templates/terminal/no/length/node.def b/op-templates/terminal/no/length/node.def new file mode 100644 index 0000000..27687f6 --- /dev/null +++ b/op-templates/terminal/no/length/node.def @@ -0,0 +1,2 @@ +help: "Disable terminal paging" +run: OFR_PAGER='cat -s' diff --git a/op-templates/terminal/no/node.def b/op-templates/terminal/no/node.def new file mode 100644 index 0000000..27687f6 --- /dev/null +++ b/op-templates/terminal/no/node.def @@ -0,0 +1,2 @@ +help: "Disable terminal paging" +run: OFR_PAGER='cat -s' diff --git a/op-templates/terminal/node.def b/op-templates/terminal/node.def new file mode 100644 index 0000000..548ca3c --- /dev/null +++ b/op-templates/terminal/node.def @@ -0,0 +1,2 @@ +help: "Set terminal page length" +run: resize; OFR_PAGER=$OFR_DEFAULT_PAGER |