From 480b1bfbce945ec1a412544f327e62346ac6765e Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Wed, 19 Jul 2023 18:37:43 +0200 Subject: [PATCH] =?utf8?q?Okre=C5=9Blono=20domy=C5=9Bln=C4=85=20pow=C5=82o?= =?utf8?q?k=C4=99=20dla=20wybranych=20kontener=C3=B3w,=20reszta=20u=C5=BCy?= =?utf8?q?wa=20BASH-a=20-=20tworzenie=20kontener=C3=B3w,=20funkcja=20'idle?= =?utf8?q?-fetch-containers',=20skrypt=20'idle.sh'?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- idle.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/idle.sh b/idle.sh index 415aebf..eff8a78 100644 --- 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"; -- 2.39.5