From: Ben Soares Date: Thu, 8 Aug 2024 09:35:43 +0000 (+0100) Subject: JAL-3631 Better messaging and a root check on updating the --installation X-Git-Tag: Release_2_11_4_0~14^2~8^2~13 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0f805a31db48d5fa56f53bb6f7da5efd81b70992;p=jalview.git JAL-3631 Better messaging and a root check on updating the --installation --- diff --git a/utils/getdown/bin/update.sh b/utils/getdown/bin/update.sh index 28755aa..03f369e 100755 --- a/utils/getdown/bin/update.sh +++ b/utils/getdown/bin/update.sh @@ -12,6 +12,7 @@ USAGE="Please use either --installation or --userspace" DEBUG=0 USERSPACE=0 INSTALLATION=0 +DISABLEROOTCHECK=0 for RAWARG in "${@}"; do ARG="${RAWARG%%=*}" case "${ARG}" in @@ -24,6 +25,9 @@ for RAWARG in "${@}"; do --userspace) USERSPACE=1 ;; + --norootcheck) + DISABLEROOTCHECK=1 + ;; *) echo "Unknown option '${ARG}'. ${USAGE}." >&2 exit 2 @@ -160,6 +164,11 @@ fi # INSTALLATION update if [ "${INSTALLATION}" = 1 ]; then + # root permissions check + if [ "${DISABLEROOTCHECK}" != 1 -a "${EUID}" != 0 ]; then + echo "--installation updates should be run with root permissions, or disable this root check with --norootcheck" >&2 + exit 6 + fi JVMARGS=( "${JVMARGS[@]}" "-Duserdefaultappdir=false" ) JVMARGS=( "${JVMARGS[@]}" "-Dnouserdefaultappdir=true" ) JVMARGS=( "${JVMARGS[@]}" "-Dlauncher.appdir=${APPDIR}" ) diff --git a/utils/install4j/macos-install-jalview.sh b/utils/install4j/macos-install-jalview.sh index 664ba90..aa9f0fd 100755 --- a/utils/install4j/macos-install-jalview.sh +++ b/utils/install4j/macos-install-jalview.sh @@ -133,6 +133,8 @@ myecho() { # no -d or -i arguments if [ "${DOWNLOAD}" = 0 -a -z "${DMGFILE}" ]; then + echo "Please use one of -d or -i options" + echo "" usage exit 0 fi