]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
autosupport: fix bashism
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 16 Oct 2012 19:16:43 +0000 (19:16 +0000)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 16 Oct 2012 19:16:43 +0000 (19:16 +0000)
'==' is bashism (bashspecific, fails when dash is /bin/sh). Anyway, a
'case' works better there.

(closes issue ASTERISK-20567)
Reported by: Tzafrir Cohen
........

Merged revisions 375059 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@375060 65c4cc65-6c06-0410-ace0-fbb531ad65f3

contrib/scripts/autosupport

index 1d2e20874d4e1db1f2576fbdefe1dfebb276cd4f..30cefe189e2719c879b82edcd2815a0e8a5a7dd9 100644 (file)
@@ -33,7 +33,8 @@ NONINTERACTIVE=0
 # If a prefix is specified on command-line, add it.
 if (set -u; : $1) 2> /dev/null
 then
-  if [ $1 == "-h" ] || [ $1 == "--help" ]; then
+  case "$1" in
+  -h | --help)
     echo
     echo "Digium autosupport script"
     echo "Copyright (C) 2005-2010, Digium, Inc."
@@ -53,12 +54,15 @@ then
     echo "    XXXXXXXX_${TARBALL_OUTPUT_FILE}"
     echo
     exit
-  elif [ $1 == "-n" ] || [ $1 == "--non-interactive" ]; then
+    ;;
+  -n | --non-interactive)
     FILE_PREFIX=
     NONINTERACTIVE=1
-  else
+    ;;
+  *)
     FILE_PREFIX="${FILE_PREFIX}${1}_";
-  fi
+    ;;
+  esac
 fi
 
 MYUID=$(id -u);