diff options
-rw-r--r-- | debian/vyatta-op.postinst.in | 2 | ||||
-rw-r--r-- | debian/vyatta-op.postrm.in | 2 | ||||
-rw-r--r-- | etc/bash_completion.d/10vyatta-op | 7 | ||||
-rw-r--r-- | functions/tech-support | 19 | ||||
-rw-r--r-- | templates/show/tech-support/save/node.tag/node.def | 2 |
5 files changed, 21 insertions, 11 deletions
diff --git a/debian/vyatta-op.postinst.in b/debian/vyatta-op.postinst.in index b95d509..4f0b3b4 100644 --- a/debian/vyatta-op.postinst.in +++ b/debian/vyatta-op.postinst.in @@ -6,4 +6,6 @@ bindir=@bindir@ # add symlinks for sudo ln -sf /usr/sbin/ethtool ${bindir}/sudo-users/ethtool +ln -sf /usr/sbin/dmidecode ${bindir}/sudo-users/dmidecode +ln -sf /sbin/iptables ${bindir}/sudo-users/iptables diff --git a/debian/vyatta-op.postrm.in b/debian/vyatta-op.postrm.in index 75d77ca..f86a7ba 100644 --- a/debian/vyatta-op.postrm.in +++ b/debian/vyatta-op.postrm.in @@ -7,5 +7,7 @@ bindir=@bindir@ if [ "$1" = "purge" ]; then # remove added symlinks rm -f ${bindir}/sudo-users/ethtool + rm -f ${bindir}/sudo-users/dmidecode + rm -f ${bindir}/sudo-users/iptables fi diff --git a/etc/bash_completion.d/10vyatta-op b/etc/bash_completion.d/10vyatta-op index 5118831..5a672c3 100644 --- a/etc/bash_completion.d/10vyatta-op +++ b/etc/bash_completion.d/10vyatta-op @@ -40,7 +40,8 @@ test -f /etc/default/vyatta && \ test ! -d "$vyatta_op_templates" && \ return 0 -declare _vyatta_op_last_comp +declare -r _vyatta_op_last_comp_init='>>>>>>LASTCOMP<<<<<<' +declare _vyatta_op_last_comp=${_vyatta_op_last_comp_init} declare _vyatta_op_node_path declare -a _vyatta_op_noncompletions _vyatta_op_completions @@ -246,7 +247,7 @@ _vyatta_op_expand () ${_vyatta_op_completions[@]} \ | eval ${VYATTA_PAGER:-cat} COMPREPLY=( "" " " ) - _vyatta_op_last_comp="" + _vyatta_op_last_comp=${_vyatta_op_last_comp_init} else _vyatta_op_last_comp="${COMP_WORDS[*]}" fi @@ -261,7 +262,7 @@ _vyatta_op_run () local restore_shopts=$( shopt -p extglob nullglob | tr \\n \; ) shopt -s extglob nullglob - _vyatta_op_last_comp="" + _vyatta_op_last_comp=${_vyatta_op_last_comp_init} false; estat=$? for arg ; do if [ -f "$tpath/$arg/node.def" ] ; then diff --git a/functions/tech-support b/functions/tech-support index 188879e..46f5827 100644 --- a/functions/tech-support +++ b/functions/tech-support @@ -13,14 +13,15 @@ function header { OUT=1 DEFAULT_PATH=/opt/vyatta/etc/config/support +DEFAULT_GROUP=users do_rotate () { local count=`ls -t $DEFAULT_PATH/*.tech-support.* 2>/dev/null |wc -l` if (( count >= 10 )); then local dfile=`ls -t $DEFAULT_PATH/*.tech-support.* 2>/dev/null |tail -1` - rm -f $dfile - echo "Removed old tech-support output file '$dfile'" + rm -f $dfile >&/dev/null \ + && echo "Removed old tech-support output file '$dfile'" fi } @@ -37,6 +38,8 @@ if [ "$1" == "save" ]; then if [[ $OUT != /* ]]; then # it's not absolute path. save in default path. mkdir -p $DEFAULT_PATH >& /dev/null + chgrp $DEFAULT_GROUP $DEFAULT_PATH >& /dev/null + chmod 775 $DEFAULT_PATH >& /dev/null OUT="$DEFAULT_PATH/$OUT" do_rotate fi @@ -75,7 +78,7 @@ header PCI Info lspci header System Info -sudo dmidecode +sudo ${vyatta_bindir}/sudo-users/dmidecode header Interfaces show interfaces @@ -141,16 +144,16 @@ header /etc/rc.local cat /etc/rc.local header \''iptables -L -vn'\' -sudo iptables -L -vn +sudo ${vyatta_bindir}/sudo-users/iptables -L -vn header \''iptables -t nat -L -vn'\' -sudo iptables -t nat -L -vn +sudo ${vyatta_bindir}/sudo-users/iptables -t nat -L -vn header \''iptables -t mangle -L -vn'\' -sudo iptables -t mangle -L -vn +sudo ${vyatta_bindir}/sudo-users/iptables -t mangle -L -vn header \''iptables -t raw -L -vn'\' -sudo iptables -t raw -L -vn +sudo ${vyatta_bindir}/sudo-users/iptables -t raw -L -vn header \''show ip route'\' show ip route @@ -165,6 +168,8 @@ header "END OF TECH-SUPPORT FILE" ) 1>&$OUT 2>&1 if [ $OUT != "1" ]; then + chgrp $DEFAULT_GROUP $OUT >& /dev/null + chmod 664 $OUT >& /dev/null echo "Done" fi diff --git a/templates/show/tech-support/save/node.tag/node.def b/templates/show/tech-support/save/node.tag/node.def index cf86a95..c8566af 100644 --- a/templates/show/tech-support/save/node.tag/node.def +++ b/templates/show/tech-support/save/node.tag/node.def @@ -1,3 +1,3 @@ help: Save consolidated tech-support report to specified file/path -allowed: echo -n 'FILE PATH' +allowed: echo -n '<FILE> <PATH>' run: source ${vyatta_datadir}/vyatta-op/functions/tech-support save $4 |