diff --git a/bin/installDeps.sh b/bin/installDeps.sh index 04e8ac13..af891211 100755 --- a/bin/installDeps.sh +++ b/bin/installDeps.sh @@ -25,13 +25,9 @@ require_minimal_version() { DETECTED_MAJOR=$(pecho $VERSION_STRING | cut -s -d "." -f 1) DETECTED_MINOR=$(pecho $VERSION_STRING | cut -s -d "." -f 2) - if [ -z "$DETECTED_MAJOR" ]; then - fatal "Cannot extract $PROGRAM_LABEL major version from version string \"$VERSION_STRING\"" - fi + [ -n "$DETECTED_MAJOR" ] || fatal "Cannot extract $PROGRAM_LABEL major version from version string \"$VERSION_STRING\"" - if [ -z "$DETECTED_MINOR" ]; then - fatal "Cannot extract $PROGRAM_LABEL minor version from version string \"$VERSION_STRING\"" - fi + [ -n "$DETECTED_MINOR" ] || fatal "Cannot extract $PROGRAM_LABEL minor version from version string \"$VERSION_STRING\"" case "$DETECTED_MAJOR" in ''|*[!0-9]*) @@ -44,9 +40,8 @@ require_minimal_version() { fatal "$PROGRAM_LABEL minor version from \"$VERSION_STRING\" is not a number. Detected: \"$DETECTED_MINOR\"" esac - if [ "$DETECTED_MAJOR" -lt "$REQUIRED_MAJOR" ] || ([ "$DETECTED_MAJOR" -eq "$REQUIRED_MAJOR" ] && [ "$DETECTED_MINOR" -lt "$REQUIRED_MINOR" ]); then - fatal "Your $PROGRAM_LABEL version \"$VERSION_STRING\" is too old. $PROGRAM_LABEL $REQUIRED_MAJOR.$REQUIRED_MINOR.x or higher is required." - fi + [ "$DETECTED_MAJOR" -gt "$REQUIRED_MAJOR" ] || ([ "$DETECTED_MAJOR" -eq "$REQUIRED_MAJOR" ] && [ "$DETECTED_MINOR" -ge "$REQUIRED_MINOR" ]) \ + || fatal "Your $PROGRAM_LABEL version \"$VERSION_STRING\" is too old. $PROGRAM_LABEL $REQUIRED_MAJOR.$REQUIRED_MINOR.x or higher is required." } # Move to the folder where ep-lite is installed diff --git a/bin/run.sh b/bin/run.sh index 9ae768f1..cab223fb 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -26,10 +26,7 @@ if [ "$(id -u)" -eq 0 ] && [ $ignoreRoot -eq 0 ]; then echo "You shouldn't start Etherpad as root!" echo "Please type 'Etherpad rocks my socks' or supply the '--root' argument if you still want to start it as root" read rocks - if [ ! "$rocks" = "Etherpad rocks my socks" ] - then - fatal "Your input was incorrect" - fi + [ "$rocks" = "Etherpad rocks my socks" ] || fatal "Your input was incorrect" fi # Prepare the environment diff --git a/bin/safeRun.sh b/bin/safeRun.sh index fca97cb1..149f95d2 100755 --- a/bin/safeRun.sh +++ b/bin/safeRun.sh @@ -33,22 +33,16 @@ if [ -d "../bin" ]; then fi # Check if a logfile parameter is set -if [ -z "${LOG}" ]; then - fatal "Set a logfile as the first parameter" -fi +[ -n "${LOG}" ] || fatal "Set a logfile as the first parameter" shift while [ 1 ] do # Try to touch the file if it doesn't exist - if [ ! -f ${LOG} ]; then - touch ${LOG} || fatal "Logfile '${LOG}' is not writeable" - fi + [ -f ${LOG} ] || touch ${LOG} || fatal "Logfile '${LOG}' is not writeable" # Check if the file is writeable - if [ ! -w ${LOG} ]; then - fatal "Logfile '${LOG}' is not writeable" - fi + [ -w ${LOG} ] || fatal "Logfile '${LOG}' is not writeable" # Start the application bin/run.sh $@ >>${LOG} 2>>${LOG}