From: xf0r3m Date: Wed, 19 Jul 2023 15:40:03 +0000 (+0200) Subject: Dodanie 5-cio sekundowej pauzy między uruchomieniem kontenera a wgraniem i uruchomien... X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=1d34e18fd93644f0c7f46068a20237065bdaa7f9;p=idle.git Dodanie 5-cio sekundowej pauzy między uruchomieniem kontenera a wgraniem i uruchomieniem skryptu startowego, próba rozwiązania problemu z siecią - tworzenie kontenerów, funkcja 'idle-fetch-containers', skrypt 'idle.sh' --- diff --git a/idle.sh b/idle.sh index a9402df..a46e0a6 100644 --- a/idle.sh +++ b/idle.sh @@ -67,11 +67,13 @@ function idle-fetch-containers() { if grep -q $containerName $DATABASE; then containerImagePath=$(grep $containerName $DATABASE | cut -d ";" -f 1); startupScript=$(grep $containerName $DATABASE | cut -d ";" -f 4); - #echo "lxc launch $containerImagePath $containerName"; /usr/bin/lxc launch $containerImagePath $containerName; - #echo "lxc file push ${HOME}/idle/$startupScript ${containerName}/root/${startupScript}"; + sec=1; + while [ $sec -le 5 ]; do + echo "Waiting $((5 - (sec - 1))) sec to get container full up"; + sec=$((sec + 1)); + done /usr/bin/lxc file push ${HOME}/idle/$startupScript ${containerName}/root/${startupScript} - #echo "lxc exec $containerName /bin/bash /root/${startupScript}"; /usr/bin/lxc exec $containerName /bin/bash /root/${startupScript} echo "Container is ready for work."; else