From 49f39216be92e51d02b0833e58c166aaec85da0c Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Sat, 15 Jul 2023 14:12:07 +0200 Subject: [PATCH] =?utf8?q?Poprawienie=20b=C5=82=C4=99d=C3=B3w=20w=20sekcji?= =?utf8?q?=20pomocy=20w=20funkcji=20'idle-fetch-containers'=20w=20skrypcie?= =?utf8?q?=20'idle.sh'?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- idle.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/idle.sh b/idle.sh index b867f4b..557df04 100644 --- a/idle.sh +++ b/idle.sh @@ -69,7 +69,7 @@ function idle-fetch-containers() { } function list-containers() { - for contName in $(grep $1 $DATABASE | cut -d ";" -f 3 | awk '{printf $1" "}'); do + for contName in $(grep $@ $DATABASE | cut -d ";" -f 3 | awk '{printf $1" "}'); do echo -e "\t\t $contName"; done } @@ -92,25 +92,25 @@ function idle-fetch-containers() { echo "$ idle-fetch-containers <--all/container_name/group_containers>"; echo; echo "Containers name:"; - for contName in $(cut -d ";" -f 1 $DATABASE | awk '{printf $1" "}'); do + for contName in $(cut -d ";" -f 3 $DATABASE | awk '{printf $1" "}'); do echo -e "\t${contName}"; done echo; echo "Groups:"; - echo -e "\t --deb - based on APT package manager (like Debian or Ubuntu)"; - grepOpts="'deb.sh'"; + echo -e "\t --deb - based on APT package manager"; + grepOpts="deb.sh"; list-containers $grepOpts; #for contName in $(grep 'deb.sh' $DATABASE | cut -d ";" -f 3 | awk '{printf $1" "}'); do # echo -e "\t\t $contName"; #done - echo -e "\t --rpm - based on RPM package manager (like CentOS or Fedora)"; - grepOpts="-E 'rpm.sh|fedora.sh|opensuse.sh|alt.sh'"; + echo -e "\t --rpm - based on RPM package manager"; + grepOpts='-E rpm.sh|fedora.sh|opensuse.sh|alt.sh'; list-containers $grepOpts; #for contName in $(grep -E 'rpm.sh|fedora.sh|opensuse.sh|alt.sh' $DATABASE | cut -d ";" -f 3 | awk '{printf $1" "}'); do # echo -e "\t\t $contName"; #done - echo -e "\t --other - other containers not fit to above group (like Arch or Gentoo)"; - grepOpts="-v -E 'rpm.sh|fedora.sh|opensuse.sh|alt.sh|deb.sh'"; + echo -e "\t --other - other containers not fit to above groups:"; + grepOpts='-v -E rpm.sh|fedora.sh|opensuse.sh|alt.sh|deb.sh'; list-containers $grepOpts; return 1; fi -- 2.39.5