From 35c64eb97469894ff2132ada32e24e60b4733ff6 Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Tue, 8 Aug 2023 11:58:57 +0200 Subject: [PATCH] =?utf8?q?Poprawienie=20funkcji=20sprawdzania=20dost=C4=99?= =?utf8?q?pno=C5=9Bci=20polece=C5=84=20-=20ckcmd,=20skrypt=20odbioru=20pol?= =?utf8?q?ece=C5=84=20CLI=20idle-clis?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- idle-clis | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/idle-clis b/idle-clis index b2d8274..eabd850 100755 --- a/idle-clis +++ b/idle-clis @@ -22,8 +22,14 @@ function doInContainers() { function ckcmd() { cmd=$2; - idle-exec-command $1 $cmd > /dev/null 2>&1; - if [ $? -eq 0 ]; then echo -e "${1}: $2 ${GREEN}${YES}${ENDCOLOR}"; + idle-exec-command $1 test -f /usr/bin/$cmd > /dev/null 2>&1; + usrBinTest=$? + idle-exec-command $1 test -f /bin/$cmd > /dev/null 2>&1; + binTest=$?; + idle-exec-command $1 test -f /usr/sbin/$cmd > /dev/null 2>&1; + sbinTest=$?; + result=$((usrBinTest * binTest * sbinTest)); + if [ $result -eq 0 ]; then echo -e "${1}: $2 ${GREEN}${YES}${ENDCOLOR}"; else echo -e "${1}: $2 ${RED}${NO}${ENDCOLOR}"; fi } -- 2.39.5