diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-12-05 14:01:46 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-12-05 14:01:46 -0800 |
commit | 1b7953907e3c6bb86b227e85485de48d490ea6bc (patch) | |
tree | b31922c71f9c84e64cc6aa90c95252e487ddde63 | |
parent | 39c6b2cb328ad2438a0eb6b6217715f80b2bda77 (diff) | |
download | vyatta-op-1b7953907e3c6bb86b227e85485de48d490ea6bc.tar.gz vyatta-op-1b7953907e3c6bb86b227e85485de48d490ea6bc.zip |
fix "show tech-support" for "users"
-rw-r--r-- | debian/vyatta-op.postinst.in | 2 | ||||
-rw-r--r-- | debian/vyatta-op.postrm.in | 2 | ||||
-rw-r--r-- | functions/tech-support | 17 | ||||
-rw-r--r-- | templates/show/tech-support/save/node.tag/node.def | 2 |
4 files changed, 15 insertions, 8 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/functions/tech-support b/functions/tech-support index 188879e..b2c9958 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 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 |