From: xf0r3m Date: Wed, 19 Jul 2023 16:37:43 +0000 (+0200) Subject: Określono domyślną powłokę dla wybranych kontenerów, reszta używa BASH-a - tworzenie... X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=480b1bfbce945ec1a412544f327e62346ac6765e;p=idle.git Określono domyślną powłokę dla wybranych kontenerów, reszta używa BASH-a - tworzenie kontenerów, funkcja 'idle-fetch-containers', skrypt 'idle.sh' --- 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";