From: Tzafrir Cohen Date: Tue, 16 Oct 2012 19:13:08 +0000 (+0000) Subject: autosupport: fix bashism X-Git-Tag: 1.8.19.0-tc1~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2377dfb58a2022a58a7e8572b5d97b478c4ab950;p=thirdparty%2Fasterisk.git autosupport: fix bashism '==' is bashism (bashspecific, fails when dash is /bin/sh). Anyway, a 'case' works better there. (closes issue ASTERISK-20567) Reported by: Tzafrir Cohen git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@375059 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/contrib/scripts/autosupport b/contrib/scripts/autosupport index 1d2e20874d..30cefe189e 100644 --- a/contrib/scripts/autosupport +++ b/contrib/scripts/autosupport @@ -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);