From 10c79449ee661fbb3c076a09ca2151cbdef0dd6c Mon Sep 17 00:00:00 2001 From: John Southworth Date: Mon, 20 Jun 2011 17:19:11 -0700 Subject: add .txt extension to the 'show tech-support brief save' output --- functions/tech-support-brief | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/functions/tech-support-brief b/functions/tech-support-brief index 333db8b..998adaf 100755 --- a/functions/tech-support-brief +++ b/functions/tech-support-brief @@ -36,19 +36,15 @@ 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" + if [[ "$2" =~ scp:///* || "$2" =~ ftp:///* ]]; then + REMOTE="1" else - OUT="$2.$HOSTNAME.tech-support.$CURTIME" - fi - else - OUT="$HOSTNAME.tech-support.$CURTIME" - fi + #file to be save locally + OUT="$2.$OUT" + fi + fi if [[ $OUT != /* ]]; then # it's not absolute path. save in default path. -- cgit v1.2.3