]> gitweb.morketsmerke.org Git - idle.git/commitdiff
Określono domyślną powłokę dla wybranych kontenerów, reszta używa BASH-a - tworzenie...
authorxf0r3m <jakubstasinski@protonmail.com>
Wed, 19 Jul 2023 16:37:43 +0000 (18:37 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Wed, 19 Jul 2023 16:37:43 +0000 (18:37 +0200)
idle.sh

diff --git a/idle.sh b/idle.sh
index 415aebfe4fb4221f7c40c0437a75d60fcd0ef4bf..eff8a786d66e7201c68ce42ff58f1531616926a5 100644 (file)
--- a/idle.sh
+++ b/idle.sh
@@ -64,6 +64,11 @@ function idle-fetch-containers() {
 
   function create-container() {
     containerName=$1;
+    if [ "$containerName"="alpine-edge" ] || [ "$containerName"="openwrt" ]; then
+      containerShell="/bin/sh";
+    else
+      containerShell="/bin/bash";
+    fi
     if grep -q $containerName $DATABASE; then 
       containerImagePath=$(grep $containerName $DATABASE | cut -d ";" -f 1);
       startupScript=$(grep $containerName $DATABASE | cut -d ";" -f 4);
@@ -75,7 +80,7 @@ function idle-fetch-containers() {
         sec=$((sec + 1));
       done 
       /usr/bin/lxc file push ${HOME}/idle/$startupScript ${containerName}/root/${startupScript}
-      /usr/bin/lxc exec $containerName /bin/bash /root/${startupScript}
+      /usr/bin/lxc exec $containerName $conatinerShell /root/${startupScript}
       echo "Container is ready for work.";
     else
       echo "Given container name doesn't exist in project database";