From: xf0r3m Date: Tue, 8 Aug 2023 09:58:57 +0000 (+0200) Subject: Poprawienie funkcji sprawdzania dostępności poleceń - ckcmd, skrypt odbioru poleceń... X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=35c64eb97469894ff2132ada32e24e60b4733ff6;p=idle.git Poprawienie funkcji sprawdzania dostępności poleceń - ckcmd, skrypt odbioru poleceń CLI idle-clis --- 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 }