From 9dbe987ac425055dbe2848b173980034e6e1d23c Mon Sep 17 00:00:00 2001 From: John Southworth Date: Thu, 16 Jun 2011 19:28:05 -0500 Subject: Bugfix 7124: make 'show tech-support save' have a .txt at the end of the file name. Make the script show the proper config path '/config/support' instead of '/opt/vyatta/etc/config/support' --- functions/tech-support | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/functions/tech-support b/functions/tech-support index ec2b915..0599c89 100755 --- a/functions/tech-support +++ b/functions/tech-support @@ -14,7 +14,7 @@ function header { OUT=1 FLAG=0 REMOTE=0 -DEFAULT_PATH=/opt/vyatta/etc/config/support +DEFAULT_PATH=/config/support DEFAULT_GROUP=users do_rotate () @@ -37,19 +37,14 @@ CURTIME=`date +%F-%H%M%S` if [ "$1" == "save" ] || [ "$1" == "save-uncompressed" ]; then # "save" or save-uncompressed is specified. save output to file. + OUT="$HOSTNAME.tech-support.$CURTIME.txt" if [ -n "$2" ]; then - if [[ "$2" =~ scp:///* ]]; then - OUT="$HOSTNAME.tech-support.$CURTIME" - REMOTE="1" - elif [[ "$2" =~ ftp:///* ]]; then - OUT="$HOSTNAME.tech-support.$CURTIME" - REMOTE="1" - else + if [[ "$2" =~ scp:///* || "$2" =~ ftp:///* ]]; then + REMOTE="1" + else #file to be save locally - OUT="$2.$HOSTNAME.tech-support.$CURTIME" - fi - else - OUT="$HOSTNAME.tech-support.$CURTIME" + OUT="$2.$OUT" + fi fi if [[ $OUT != /* ]]; then -- cgit v1.2.3