implement checkPrerequisites() and make a use from it
This commit is contained in:
parent
e6ce238bf4
commit
d3dc2aa2b3
5
ezbuild
5
ezbuild
|
@ -14,3 +14,8 @@ source ${EZROOT}/libraries/common
|
|||
# Load EzBuild libraries & configuration
|
||||
loadLibraries
|
||||
loadConfiguration
|
||||
|
||||
# Check system requirements
|
||||
printInfo "Checking system prerequisites..."
|
||||
checkPrerequisites
|
||||
[ ${?} -ne 0 ] && die "Your environment does not meet EzBuild requirements"
|
||||
|
|
5
ezsync
5
ezsync
|
@ -14,3 +14,8 @@ source ${EZROOT}/libraries/common
|
|||
# Load EzBuild libraries & configuration
|
||||
loadLibraries
|
||||
loadConfiguration
|
||||
|
||||
# Check system requirements
|
||||
printInfo "Checking system prerequisites..."
|
||||
checkPrerequisites
|
||||
[ ${?} -ne 0 ] && die "Your environment does not meet EzBuild requirements"
|
||||
|
|
|
@ -3,6 +3,34 @@
|
|||
# Distributed under the terms of the GNU General Public License v3
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Checks if system running EzBuild meets its requirements
|
||||
#-------------------------------------------------------------------------------
|
||||
function checkPrerequisites() {
|
||||
if [ "$(uname -s)" != "Linux" ]; then
|
||||
printError "You are trying to launch ${EZNAME} on non-Linux system!"
|
||||
return 1
|
||||
fi
|
||||
if [ "${EUID}" != "0" ] && [ "${USER}" != "root" ]; then
|
||||
printError "The ${EZNAME} needs to be launched from root account!"
|
||||
return 1
|
||||
fi
|
||||
if [ ! -e /dev/null ]; then
|
||||
printError "The /dev directory seems to be not mounted!"
|
||||
return 1
|
||||
fi
|
||||
if [ ! -e /proc/mounts ]; then
|
||||
printError "The /proc directory seems to be not mounted!"
|
||||
return 1
|
||||
fi
|
||||
ping -c 1 google.com &> /dev/null
|
||||
if [ ${?} -ne 0 ]; then
|
||||
printError "There seems to be no Internet conectivity!"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Tests for a minimum version level by comparing version numbers
|
||||
# Parameters: %min_version% %test_version%
|
||||
|
|
Loading…
Reference in New Issue