Added Branch support (#44)

moved command line argument processing to a separate script so it can be
shared
added --use-system-master to allow user to use master branch instead of
detected master
This commit is contained in:
Mafoo
2016-09-29 17:57:50 +01:00
committed by FusionPBX
parent 0ba5e906b2
commit eda28f4efd
4 changed files with 70 additions and 42 deletions

39
debian/install.sh vendored
View File

@@ -3,44 +3,7 @@
#move to script directory so all relative paths work
cd "$(dirname "$0")"
. resources/colors.sh
#Process command line options
ARGS=$(getopt -n 'install.sh' -o h -l help,use-switch-source,use-switch-package-all,use-switch-master,use-switch-package-unofficial-arm,no-cpu-check -- "$@")
if [ $? -ne 0 ]; then
error "Failed parsing options."
exit 1
fi
export USE_SWITCH_SOURCE=false
export USE_SWITCH_PACKAGE_ALL=false
export USE_SWITCH_PACKAGE_UNOFFICIAL_ARM=false
export USE_SWITCH_MASTER=false
export CPU_CHECK=true
HELP=false
while true; do
case "$1" in
--use-switch-source ) export USE_SWITCH_SOURCE=true; shift ;;
--use-switch-package-all ) export USE_SWITCH_PACKAGE_ALL=true; shift ;;
--use-switch-master ) export USE_SWITCH_MASTER=true; shift ;;
--no-cpu-check ) export CPU_CHECK=false; shift ;;
-h | --help ) HELP=true; shift ;;
-- ) shift; break ;;
* ) break ;;
esac
done
if [ $HELP = true ]; then
warning "Debian installer script"
warning " --use-switch-source will use freeswitch from source rather than ${green}(default:packages)"
warning " --use-switch-package-all if using packages use the meta-all package"
warning " --use-switch-package-unofficial-arm if your system is arm and you are using packages, use the unofficial arm repo"
warning " --use-switch-master will use master branch/packages instead of ${green}(default:stable)"
warning " --no-cpu-check disable the cpu check ${green}(default:check)"
exit;
fi
. resources/arguments.sh
if [ $CPU_CHECK = true ] && [ $USE_SWITCH_SOURCE = false ]; then
#check what the CPU and OS are