arguments.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. #Process command line options only if we haven't been processed once
  3. if [ -z "$CPU_CHECK" ]; then
  4. export script_name=`basename "$0"`
  5. ARGS=$(getopt -n '$script_name' -o h -l help,use-switch-source,use-switch-package-all,use-switch-master,use-switch-package-unofficial-arm,use-system-master,no-cpu-check -- "$@")
  6. if [ $? -ne 0 ]; then
  7. error "Failed parsing options."
  8. exit 1
  9. fi
  10. export USE_SWITCH_SOURCE=false
  11. export USE_SWITCH_PACKAGE_ALL=false
  12. export USE_SWITCH_PACKAGE_UNOFFICIAL_ARM=false
  13. export USE_SWITCH_MASTER=false
  14. export USE_SYSTEM_MASTER=false
  15. export CPU_CHECK=true
  16. HELP=false
  17. while true; do
  18. case "$1" in
  19. --use-switch-source ) export USE_SWITCH_SOURCE=true; shift ;;
  20. --use-switch-package-all ) export USE_SWITCH_PACKAGE_ALL=true; shift ;;
  21. --use-switch-master ) export USE_SWITCH_MASTER=true; shift ;;
  22. --use-system-master ) export USE_SYSTEM_MASTER=true; shift ;;
  23. --no-cpu-check ) export CPU_CHECK=false; shift ;;
  24. -h | --help ) HELP=true; shift ;;
  25. -- ) shift; break ;;
  26. * ) break ;;
  27. esac
  28. done
  29. if [ .$HELP = .true ]; then
  30. warning "Debian installer script"
  31. warning " --use-switch-source will use freeswitch from source rather than ${green}(default:packages)"
  32. warning " --use-switch-package-all if using packages use the meta-all package"
  33. warning " --use-switch-package-unofficial-arm if your system is arm and you are using packages, use the unofficial arm repo"
  34. warning " --use-switch-master will use master branch/packages for the switch instead of ${green}(default:stable)"
  35. warning " --use-system-master will use master branch/packages for the system instead of ${green}(default:stable)"
  36. warning " --no-cpu-check disable the cpu check ${green}(default:check)"
  37. exit;
  38. fi
  39. fi