From 5726882cc933ecfbca76f65bd2d733c593afea6b Mon Sep 17 00:00:00 2001 From: fukiame Date: Wed, 23 Jul 2025 01:55:24 +0700 Subject: [PATCH] chore: mbcpapp.sh: dont use /usr/bin as command check command -v and or executing the binary itself is a good enough rudimentary check "fix" "nonexistent" command on Termux also drop redundant $JAVA Signed-off-by: fukiame --- MBCPApp/mbcpapp.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/MBCPApp/mbcpapp.sh b/MBCPApp/mbcpapp.sh index 07f1c49..868d520 100755 --- a/MBCPApp/mbcpapp.sh +++ b/MBCPApp/mbcpapp.sh @@ -23,9 +23,8 @@ if [ -f /proc/sys/fs/binfmt_misc/WSLInterop ]; then fi # Check if figlet exists or not -if [ -x /usr/bin/figlet ] -then - FIGLET=/usr/bin/figlet +if command -v figlet ; then + FIGLET=figlet else echo "WARN : figlet not found, ignoring banner !" FIGLET=: @@ -36,16 +35,12 @@ COMMIT='git rev-parse --short HEAD' # Check if java exists on /usr/bin/java echo Checking if Java exists... -if [ -x /usr/bin/java ] -then - JAVA=/usr/bin/java +if java -version ; then clear else - echo "ERROR : Java not found on [/usr/bin/java] !!!" + echo "ERROR : Java not found !!!" echo "INFO : Please install Java for your Linux distribution ! " - echo "INFO : If you have different JDK location, be sure link it" - exit - JAVA=: + exit 127 fi # Banner