From 60408eec63565012c41924574528dd102e4e5093 Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Mon, 7 Aug 2023 19:59:33 +0200 Subject: [PATCH] =?utf8?q?Poprawienie=20=C5=9Bcie=C5=BCki=20wskazuj=C4=85c?= =?utf8?q?ej=20na=20g=C5=82=C3=B3wn=C4=85=20bibliotek=C4=99.=20Uruchomieni?= =?utf8?q?e=20opcji=20'check-command'=20-=20skrypt=20odbioru=20polece?= =?utf8?q?=C5=84=20CLI=20-=20idle-clis.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- idle-clis | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) mode change 100644 => 100755 idle-clis diff --git a/idle-clis b/idle-clis old mode 100644 new mode 100755 index 90c200f..5632132 --- a/idle-clis +++ b/idle-clis @@ -1,13 +1,37 @@ #!/bin/bash +RED="\e[31m"; +GREEN="\e[32m"; +ENDCOLOR="\e[0m"; +YES="\u2714"; +NO="\u2716"; + +function ckcmd() { + cmd=$2; + idle-exec-command $1 $cmd > /dev/null 2>&1; + if [ $? -eq 0 ]; then echo -e "${1}: $2 ${GREEN}${YES}${ENDCOLOR}"; + else echo -e "${1}: $2 ${RED}${NO}${ENDCOLOR}"; + fi +} + if [ $# -gt 0 ]; then - source /usr/share/local/idle; + source /usr/local/bin/idle; command=$1; shift; case $command in "list-distros") idle-list-containers; break;; "shell") idle-exec-shell $2; exit;; - "check-command") idle-exec-command $2; exit;; + "check-command") + containerName=$1; + if [ "$containerName" = "--all" ]; then + containerList=$(idle-list-containers | awk '{printf $1" "}' | sed 's/://g'); + for containerName in $containerList; do + ckcmd $containerName $2; + done + else + ckcmd $containerName $2; + fi + exit;; "apropos") idle-apropos $@; exit;; "pkgsearch") idle-pkg-search $@; break;; esac -- 2.39.5