]> gitweb.morketsmerke.org Git - idle.git/commitdiff
database.csv - dodanie pola z nazwą domyślnego użytkownika (będzie potrzebna do nowyc...
authorxf0r3m <jakubstasinski@protonmail.com>
Mon, 7 Aug 2023 16:34:00 +0000 (18:34 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Mon, 7 Aug 2023 16:34:00 +0000 (18:34 +0200)
database.csv
idle.sh

index 2eb41ca1245c5c0e8d6ce2a23f1e26eef4b13b18..0cfdd4248a40a80addba89d57ddcb85dd45ee57c 100644 (file)
@@ -1,13 +1,11 @@
-images:alpine/edge/amd64;10.1M;alpine-edge;alpine.sh;Alpine edge amd64 (20230714_13:01)
-images:alt/Sisyphus/amd64;957M;alt-sisyphus;alt.sh;Alt Sisyphus amd64 (20230715_01:17)
-images:archlinux;747M;archlinux;archlinux.sh;Archlinux current amd64 (20230715_04:18)
-images:centos/9-Stream;446M;centos9;rpm.sh;Centos 9-Stream amd64 (20230714_07:08)
-images:debian/sid;425M;debian;deb.sh;Debian sid amd64 (20230715_05:24)
-images:fedora/Rawhide;504M;fedora;fedora.sh;Fedora Rawhide amd64 (20230714_20:33)
-images:gentoo/systemd;1900M;gentoo;gentoo.sh;Gentoo current amd64 (20230714_17:43)
-images:kali;389M;kali;deb.sh;Kali current amd64 (20230714_17:15)
-images:opensuse/tumbleweed;193M;opensuse;opensuse.sh;Opensuse tumbleweed amd64 (20230715_04:20)
-images:openwrt/snapshot;12.4M;openwrt;openwrt.sh;Openwrt snapshot amd64 (20230714_11:57)
-images:rockylinux/9;435M;rocky9;rpm.sh;Rockylinux 9 amd64 (20230715_02:06)
-images:ubuntu/mantic;513M;ubuntu;deb.sh;Ubuntu mantic amd64 (20230714_07:42)
-images:voidlinux;248M;void;void.sh;Voidlinux current amd64 (20230714_17:11)
+images:alpine/edge/amd64;10.1M;alpine-edge;alpine.sh;alpuser;Alpine edge amd64 (20230714_13:01)
+images:archlinux;747M;archlinux;archlinux.sh;archuser;Archlinux current amd64 (20230715_04:18)
+images:debian/sid;425M;debian;deb.sh;debuser;Debian sid amd64 (20230715_05:24)
+images:fedora/Rawhide;504M;fedora;fedora.sh;rhuser;Fedora Rawhide amd64 (20230714_20:33)
+images:gentoo/systemd;1900M;gentoo;gentoo.sh;gentoouser;Gentoo current amd64 (20230714_17:43)
+images:kali;389M;kali;deb.sh;debuser;Kali current amd64 (20230714_17:15)
+images:opensuse/tumbleweed;193M;opensuse;opensuse.sh;suseuser;Opensuse tumbleweed amd64 (20230715_04:20)
+images:openwrt/snapshot;12.4M;openwrt;openwrt.sh;openwrt;Openwrt snapshot amd64 (20230714_11:57)
+images:rockylinux/9;435M;rocky9;rpm.sh;rhuser;Rockylinux 9 amd64 (20230715_02:06)
+images:ubuntu/mantic;513M;ubuntu;deb.sh;debuser;Ubuntu mantic amd64 (20230714_07:42)
+images:voidlinux;248M;void;void.sh;voiduser;Voidlinux current amd64 (20230714_17:11)
diff --git a/idle.sh b/idle.sh
index 652971db9fcfb3ae3d3a514d62e4345c84146bd2..809ae3b4c49ebbfbc68b5213e2c6b02bf2799bde 100644 (file)
--- a/idle.sh
+++ b/idle.sh
@@ -50,7 +50,7 @@ function idle-list-containers() {
       else
         installed="\e[31m\u2716\e[0m";
       fi
-      desc=$(grep "$container" $DATABASE | cut -d ";" -f 5);
+      desc=$(grep "$container" $DATABASE | cut -d ";" -f 6);
       echo -e "${container}: $desc $installed"; 
     done
   fi
@@ -105,43 +105,48 @@ function idle-fetch-containers() {
     done 
   }
 
-  if [ "$1" ]; then
-    if [ "$1" = "--all" ]; then
-      containerNameList=$(cut -d ";" -f 3 $DATABASE | awk '{printf $1" "}');
-      for contName in $containerNameList; do
-       create-container $contName; 
-      done
-    elif [ "$1" = "--deb" ]; then
-      mass-create-container $debGrepOpts;
-    elif [ "$1" = "--rpm" ]; then
-      mass-create-container $rpmGrepOpts;
-    elif [ "$1" = "--other" ]; then
-      mass-create-container $otherGrepOpts;
-    elif echo $1 | grep -q '\,'; then
-      mass-create-container $1;
-    else
-      contName=$1;
-      create-container $contName;
-    fi 
+  if ! lxc profile show default | grep -q 'idle'; then
+    echo -e "${RED}LXD isn't initialized. You must run 'idle-lxd-init' firs${ENDCOLOR}";
+    exit 1;
   else
-    echo "idle-fetch-containers - fetch IDLE containers";
-    echo "IDLE Project @ 2023 morketsmerke.org";
-    echo;
-    echo "Usage: ";
-    echo "$ idle-fetch-containers <--all/container_name/group_containers>";
-    echo;
-    echo "Containers name:";
-    for contName in $(cut -d ";" -f 3 $DATABASE | awk '{printf $1" "}'); do
-      echo -e "  ${contName}";
-    done
-    echo;
-    echo "Groups:";
-    echo -e "  --deb - based on APT package manager";
-    list-containers $debGrepOpts;
-    echo -e "  --rpm - based on RPM package manager";
-    list-containers $rpmGrepOpts;
-    echo -e "  --other - other containers not fit to above groups:";
-    list-containers $otherGrepOpts;
-    return 1;
+    if [ "$1" ]; then
+      if [ "$1" = "--all" ]; then
+        containerNameList=$(cut -d ";" -f 3 $DATABASE | awk '{printf $1" "}');
+        for contName in $containerNameList; do
+          create-container $contName; 
+        done
+      elif [ "$1" = "--deb" ]; then
+        mass-create-container $debGrepOpts;
+      elif [ "$1" = "--rpm" ]; then
+        mass-create-container $rpmGrepOpts;
+      elif [ "$1" = "--other" ]; then
+        mass-create-container $otherGrepOpts;
+      elif echo $1 | grep -q '\,'; then
+        mass-create-container $1;
+      else
+        contName=$1;
+        create-container $contName;
+      fi 
+    else
+      echo "idle-fetch-containers - fetch IDLE containers";
+      echo "IDLE Project @ 2023 morketsmerke.org";
+      echo;
+      echo "Usage: ";
+      echo "$ idle-fetch-containers <--all/container_name/group_containers>";
+      echo;
+      echo "Containers name:";
+      for contName in $(cut -d ";" -f 3 $DATABASE | awk '{printf $1" "}'); do
+        echo -e "  ${contName}";
+      done
+      echo;
+      echo "Groups:";
+      echo -e "  --deb - based on APT package manager";
+      list-containers $debGrepOpts;
+      echo -e "  --rpm - based on RPM package manager";
+      list-containers $rpmGrepOpts;
+      echo -e "  --other - other containers not fit to above groups:";
+      list-containers $otherGrepOpts;
+      return 1;
+    fi
   fi
 }