|
|
|
@ -15,36 +15,25 @@ source ${EZROOT}/libraries/common
|
|
|
|
|
loadLibraries |
|
|
|
|
loadConfiguration |
|
|
|
|
|
|
|
|
|
# Do not allow more than one working copy |
|
|
|
|
PID=$(pidof -s -o '%PPID' -x ${EZNAME}) |
|
|
|
|
if [ ${PID} ]; then |
|
|
|
|
printWarn "The ${EZNAME} is already working with PID: ${PID}" |
|
|
|
|
printWarn "You cannot have more than one instancy running" |
|
|
|
|
exit 0 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
# Print EzBuild notice and parse arguments |
|
|
|
|
printNotice |
|
|
|
|
until [[ -z "${1}" ]]; do |
|
|
|
|
case "${1}" in |
|
|
|
|
-c|--cleanlog) |
|
|
|
|
printInfo "Clearing log files..." |
|
|
|
|
cleanLog |
|
|
|
|
EZOPT_CLEANLOG=true |
|
|
|
|
;; |
|
|
|
|
-h|--help) |
|
|
|
|
showEzsyncUsage |
|
|
|
|
;; |
|
|
|
|
-p|--purge) |
|
|
|
|
printInfo "Clearing temp directory..." |
|
|
|
|
cleanTemp |
|
|
|
|
EZOPT_PURGETMP=true |
|
|
|
|
;; |
|
|
|
|
-P|--purgeonly) |
|
|
|
|
printInfo "Clearing temp directory..." |
|
|
|
|
cleanTemp |
|
|
|
|
quit |
|
|
|
|
EZOPT_PURGETMP=true |
|
|
|
|
EZOPT_PURGEONLY=true |
|
|
|
|
;; |
|
|
|
|
-s|--syscheck) |
|
|
|
|
EZOPT_SYSCHECKONLY=1 |
|
|
|
|
EZOPT_SYSCHECKONLY=true |
|
|
|
|
;; |
|
|
|
|
*) |
|
|
|
|
die "Unrecognized option ${1}" |
|
|
|
@ -56,8 +45,28 @@ done
|
|
|
|
|
# Check system requirements |
|
|
|
|
printInfo "Checking system prerequisites..." |
|
|
|
|
checkPrerequisites |
|
|
|
|
[ ${?} -ne 0 ] && die "Your environment does not meet EzBuild requirements!" |
|
|
|
|
[ ${?} -ne 0 ] && die "Your environment does not meet EzBuild requirements!" 1 |
|
|
|
|
if isEnabled ${EZOPT_SYSCHECKONLY}; then |
|
|
|
|
printInfo "Your system meets all EzBuild requirements!" |
|
|
|
|
quit |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
# Do not allow more than one working copy |
|
|
|
|
PID=$(pidof -s -o '%PPID' -x ${EZNAME}) |
|
|
|
|
if [ ${PID} ]; then |
|
|
|
|
printWarn "The ${EZNAME} is already working with PID: ${PID}" |
|
|
|
|
printWarn "You cannot have more than one instancy running" |
|
|
|
|
exit 0 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
# Optionally purge temp directory or log file only |
|
|
|
|
if isEnabled ${EZOPT_PURGETMP}; then |
|
|
|
|
printInfo "Clearing temp directory..." |
|
|
|
|
cleanTemp |
|
|
|
|
if isEnabled ${EZOPT_PURGEONLY}; then |
|
|
|
|
quit |
|
|
|
|
fi |
|
|
|
|
elif isEnabled ${EZOPT_CLEANLOG}; then |
|
|
|
|
printInfo "Clearing log file..." |
|
|
|
|
cleanLog |
|
|
|
|
fi |
|
|
|
|