Shorten the parameter names used in the install script. I'm considering shortening them further.

This commit is contained in:
markjcrane
2016-06-04 13:21:32 -06:00
parent bfd6075f14
commit 98e386458b
3 changed files with 22 additions and 22 deletions

36
debian/install.sh vendored
View File

@@ -1,23 +1,23 @@
#!/bin/sh #!/bin/sh
#Process command line options #Process command line options
OPTS=`getopt -n 'install.sh' -o h -l help,use-freeswitch-source,use-freeswitch-package-all,use-freeswitch-master,use-freeswitch-package-unofficial-arm -- "$@"` OPTS=`getopt -n 'install.sh' -o h -l help,use-switch-source,use-switch-package-all,use-switch-master,use-switch-package-unofficial-arm -- "$@"`
eval set -- "$OPTS" eval set -- "$OPTS"
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
export USE_FREESWITCH_SOURCE=false export USE_SWITCH_SOURCE=false
export USE_FREESWITCH_PACKAGE_ALL=false export USE_SWITCH_PACKAGE_ALL=false
export USE_FREESWITCH_PACKAGE_UNOFFICIAL_ARM=false export USE_SWITCH_PACKAGE_UNOFFICIAL_ARM=false
export USE_FREESWITCH_MASTER=false export USE_SWITCH_MASTER=false
HELP=false HELP=false
while true; do while true; do
case "$1" in case "$1" in
--use-freeswitch-source ) export USE_FREESWITCH_SOURCE=true; shift ;; --use-switch-source ) export USE_SWITCH_SOURCE=true; shift ;;
--use-freeswitch-package-all ) export USE_FREESWITCH_PACKAGE_ALL=true; shift ;; --use-switch-package-all ) export USE_SWITCH_PACKAGE_ALL=true; shift ;;
--use-freeswitch-package-unofficial-arm ) export USE_FREESWITCH_PACKAGE_UNOFFICIAL_ARM=true; shift ;; --use-switch-package-unofficial-arm ) export USE_SWITCH_PACKAGE_UNOFFICIAL_ARM=true; shift ;;
--use-freeswitch-master ) export USE_FREESWITCH_MASTER=true; shift ;; --use-switch-master ) export USE_SWITCH_MASTER=true; shift ;;
-h | --help ) HELP=true; shift ;; -h | --help ) HELP=true; shift ;;
-- ) shift; break ;; -- ) shift; break ;;
* ) break ;; * ) break ;;
@@ -26,10 +26,10 @@ done
if [ $HELP = true ]; then if [ $HELP = true ]; then
echo "Debian installer script" echo "Debian installer script"
echo " --use-freeswitch-source will use freeswitch from source rather than (default:packages)" echo " --use-switch-source will use freeswitch from source rather than (default:packages)"
echo " --use-freeswitch-package-all if using packages use the meta-all package" echo " --use-switch-package-all if using packages use the meta-all package"
echo " --use-freeswitch-package-unofficial-arm if your system is arm and you are using packages, use the unofficial arm repo" echo " --use-switch-package-unofficial-arm if your system is arm and you are using packages, use the unofficial arm repo"
echo " --use-freeswitch-master will use master branch/packages instead of (default:stable)" echo " --use-switch-master will use master branch/packages instead of (default:stable)"
exit; exit;
fi fi
@@ -50,22 +50,22 @@ resources/nginx.sh
resources/fail2ban.sh resources/fail2ban.sh
#FreeSWITCH #FreeSWITCH
if [ $USE_FREESWITCH_SOURCE = true ]; then if [ $USE_SWITCH_SOURCE = true ]; then
if [ $USE_FREESWITCH_MASTER = true ]; then if [ $USE_SWITCH_MASTER = true ]; then
resources/switch/source-master.sh resources/switch/source-master.sh
else else
resources/switch/source-release.sh resources/switch/source-release.sh
fi fi
resources/switch/source-permissions.sh resources/switch/source-permissions.sh
else else
if [ $USE_FREESWITCH_MASTER = true ]; then if [ $USE_SWITCH_MASTER = true ]; then
if [ $USE_FREESWITCH_PACKAGE_ALL = true ]; then if [ $USE_SWITCH_PACKAGE_ALL = true ]; then
resources/switch/package-master-all.sh resources/switch/package-master-all.sh
else else
resources/switch/package-master.sh resources/switch/package-master.sh
fi fi
else else
if [ $USE_FREESWITCH_PACKAGE_ALL = true ]; then if [ $USE_SWITCH_PACKAGE_ALL = true ]; then
resources/switch/package-all.sh resources/switch/package-all.sh
else else
resources/switch/package-release.sh resources/switch/package-release.sh

View File

@@ -1,11 +1,11 @@
#!/bin/sh #!/bin/sh
#initialize variable encase we are called directly #initialize variable encase we are called directly
[ -z $USE_FREESWITCH_PACKAGE_UNOFFICIAL_ARM ] && USE_FREESWITCH_PACKAGE_UNOFFICIAL_ARM=false [ -z $USE_SWITCH_PACKAGE_UNOFFICIAL_ARM ] && USE_SWITCH_PACKAGE_UNOFFICIAL_ARM=false
apt-get update && apt-get install -y --force-yes curl memcached haveged apt-get update && apt-get install -y --force-yes curl memcached haveged
arch=$(uname -m) arch=$(uname -m)
if [ $arch = 'armv7l' ] && [ $USE_FREESWITCH_PACKAGE_UNOFFICIAL_ARM = true ]; then if [ $arch = 'armv7l' ] && [ $USE_SWITCH_PACKAGE_UNOFFICIAL_ARM = true ]; then
echo "deb http://repo.sip247.com/debian/freeswitch-stable-armhf/ jessie main" > /etc/apt/sources.list.d/freeswitch.list echo "deb http://repo.sip247.com/debian/freeswitch-stable-armhf/ jessie main" > /etc/apt/sources.list.d/freeswitch.list
curl http://repo.sip247.com/debian/sip247.com.gpg.key | apt-key add - curl http://repo.sip247.com/debian/sip247.com.gpg.key | apt-key add -
else else

View File

@@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
#initialize variable encase we are called directly #initialize variable encase we are called directly
[ -z $USE_FREESWITCH_PACKAGE_UNOFFICIAL_ARM ] && USE_FREESWITCH_PACKAGE_UNOFFICIAL_ARM=false [ -z $USE_SWITCH_PACKAGE_UNOFFICIAL_ARM ] && USE_SWITCH_PACKAGE_UNOFFICIAL_ARM=false
apt-get update && apt-get install -y --force-yes curl memcached haveged apt-get update && apt-get install -y --force-yes curl memcached haveged
arch=$(uname -m) arch=$(uname -m)
if [ $arch = 'armv7l' ] && [ $USE_FREESWITCH_PACKAGE_UNOFFICIAL_ARM = true ]; then if [ $arch = 'armv7l' ] && [ $USE_SWITCH_PACKAGE_UNOFFICIAL_ARM = true ]; then
echo "deb http://repo.sip247.com/debian/freeswitch-stable-armhf/ jessie main" > /etc/apt/sources.list.d/freeswitch.list echo "deb http://repo.sip247.com/debian/freeswitch-stable-armhf/ jessie main" > /etc/apt/sources.list.d/freeswitch.list
curl http://repo.sip247.com/debian/sip247.com.gpg.key | apt-key add - curl http://repo.sip247.com/debian/sip247.com.gpg.key | apt-key add -
else else