let ezsync parse supplied arguments
This commit is contained in:
parent
0cee36547d
commit
1d539c7b3a
33
ezsync
33
ezsync
|
@ -17,8 +17,39 @@ loadConfiguration
|
||||||
|
|
||||||
# Print EzBuild notice and parse arguments
|
# Print EzBuild notice and parse arguments
|
||||||
printNotice
|
printNotice
|
||||||
|
until [[ -z "${1}" ]]; do
|
||||||
|
case "${1}" in
|
||||||
|
-c|--cleanlog)
|
||||||
|
printInfo "Clearing log files..."
|
||||||
|
cleanLogs
|
||||||
|
;;
|
||||||
|
-h|--help)
|
||||||
|
printEzsyncUsage
|
||||||
|
;;
|
||||||
|
-p|--purge)
|
||||||
|
printInfo "Clearing temp directory..."
|
||||||
|
cleanTemp
|
||||||
|
;;
|
||||||
|
-P|--purgeonly)
|
||||||
|
printInfo "Clearing temp directory..."
|
||||||
|
cleanTemp
|
||||||
|
quit
|
||||||
|
;;
|
||||||
|
-s|--syscheck)
|
||||||
|
EZOPT_SYSCHECKONLY=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
die "Unrecognized option ${1}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
# Check system requirements
|
# Check system requirements
|
||||||
printInfo "Checking system prerequisites..."
|
printInfo "Checking system prerequisites..."
|
||||||
checkPrerequisites
|
checkPrerequisites
|
||||||
[ ${?} -ne 0 ] && die "Your environment does not meet EzBuild requirements"
|
[ ${?} -ne 0 ] && die "Your environment does not meet EzBuild requirements!"
|
||||||
|
if isEnabled ${EZOPT_SYSCHECKONLY}; then
|
||||||
|
printInfo "Your system meets all EzBuild requirements!"
|
||||||
|
quit
|
||||||
|
fi
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Completely removes log files
|
# Completely removes log file
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
function cleanLogs() {
|
function cleanLogs() {
|
||||||
rm -rf ${LOGFILE} &> /dev/null
|
rm -rf ${LOGFILE} &> /dev/null
|
||||||
|
|
Loading…
Reference in New Issue