reGen2 Linux Release Metatool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.7 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. #!/bin/bash
  2. # Copyright 2010-2012, Asio Software Technologies
  3. # Distributed under the terms of the GNU General Public License v3
  4. # Declare basic system variables
  5. EZNAME=$(basename ${0})
  6. EZROOT=$(dirname $(readlink -ne ${0}))
  7. # Load necessary files
  8. source /etc/profile
  9. source ${EZROOT}/libraries/common
  10. # Load EzBuild libraries & configuration
  11. loadLibraries
  12. loadConfiguration
  13. # Print EzBuild notice and parse arguments
  14. printNotice
  15. until [[ -z "${1}" ]]; do
  16. case "${1}" in
  17. -c|--cleanlog)
  18. EZOPT_CLEANLOG=true
  19. ;;
  20. -h|--help)
  21. showEzsyncUsage
  22. ;;
  23. -p|--purge)
  24. EZOPT_PURGETMP=true
  25. ;;
  26. -P|--purgeonly)
  27. EZOPT_PURGETMP=true
  28. EZOPT_PURGEONLY=true
  29. ;;
  30. -s|--syscheck)
  31. EZOPT_SYSCHECKONLY=true
  32. ;;
  33. *)
  34. die "Unrecognized option ${1}"
  35. ;;
  36. esac
  37. shift
  38. done
  39. # Check system requirements
  40. printInfo "Checking system prerequisites..."
  41. checkPrerequisites
  42. [ ${?} -ne 0 ] && die "Your environment does not meet EzBuild requirements!" 1
  43. if isEnabled ${EZOPT_SYSCHECKONLY}; then
  44. printInfo "Your system meets all EzBuild requirements!"
  45. quit
  46. fi
  47. # Do not allow more than one working copy
  48. PID=$(pidof -s -o '%PPID' -x ${EZNAME})
  49. if [ ${PID} ]; then
  50. printWarn "The ${EZNAME} is already working with PID: ${PID}"
  51. printWarn "You cannot have more than one instancy running"
  52. exit 0
  53. fi
  54. # Optionally purge whole temp directory or log file only
  55. if isEnabled ${EZOPT_PURGETMP}; then
  56. printInfo "Clearing temp directory..."
  57. cleanTemp
  58. if isEnabled ${EZOPT_PURGEONLY}; then
  59. quit
  60. fi
  61. elif isEnabled ${EZOPT_CLEANLOG}; then
  62. printInfo "Clearing log file..."
  63. cleanLog
  64. fi
  65. # Create all necessary directories
  66. makeCoreDirectories
  67. [ ${?} -ne 0 ] && die "EzBuild was unable to create all necessary directories!" 1