]> gitweb.morketsmerke.org Git - idle.git/commitdiff
Poprawienie błędów w sekcji pomocy w funkcji 'idle-fetch-containers' w skrypcie ...
authorxf0r3m <jakubstasinski@protonmail.com>
Sat, 15 Jul 2023 12:12:07 +0000 (14:12 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Sat, 15 Jul 2023 12:12:07 +0000 (14:12 +0200)
idle.sh

diff --git a/idle.sh b/idle.sh
index b867f4bc7eb74997334a79a255f374969d325c4e..557df044408efac85d101a3b034c8c6adbd60d72 100644 (file)
--- 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