summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-06-20 17:19:11 -0700
committerJohn Southworth <john.southworth@vyatta.com>2011-06-20 17:19:11 -0700
commit10c79449ee661fbb3c076a09ca2151cbdef0dd6c (patch)
tree86da4d40b5acbaa58a37c628a4584ddaf6013a28
parent17d8d0e1779c86d0fe633470b5a8eace3f11ce9d (diff)
downloadvyatta-op-10c79449ee661fbb3c076a09ca2151cbdef0dd6c.tar.gz
vyatta-op-10c79449ee661fbb3c076a09ca2151cbdef0dd6c.zip
add .txt extension to the 'show tech-support brief save' output
-rwxr-xr-xfunctions/tech-support-brief18
1 files 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.