]> gitweb.morketsmerke.org Git - idle.git/commitdiff
Poprawienie funkcji sprawdzania dostępności poleceń - ckcmd, skrypt odbioru poleceń...
authorxf0r3m <jakubstasinski@protonmail.com>
Tue, 8 Aug 2023 09:58:57 +0000 (11:58 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Tue, 8 Aug 2023 09:58:57 +0000 (11:58 +0200)
idle-clis

index b2d8274333c8a0fa14f955093bafbd964423b305..eabd85073cbf67a7402df85099a7c30080fe57ab 100755 (executable)
--- 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
 }