summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.