Skip to content

Instantly share code, notes, and snippets.

@kphrx
Created December 6, 2016 13:02
Show Gist options
  • Save kphrx/806b46791ffd53b4e8b149a431e325d0 to your computer and use it in GitHub Desktop.
Save kphrx/806b46791ffd53b4e8b149a431e325d0 to your computer and use it in GitHub Desktop.
#!/bin/bash
CMDNAME=`basename $0`
while getopts v: OPT
do
case ${OPT} in
"v" ) FLR_v="TRUE"
NGXVER="${OPTARG}"
;;
* ) echo "Usage: $CMDNAME [-v <Nginx Version>]" 1>&2
exit 1
;;
done
if [ "$FLG_v" = "TRUE" ]; then
wget http://nginx.org/download/nginx-${NGXVER}.tar.gz
tar -xzvf nginx-${NGXVER}.tar.gz
else
echo "Usage: $CMDNAME [-v <Nginx Version>]" 1>&2
exit 2
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment