declare -a casy i=0 while true do cas=$(date +"%s") if node . $posel $posledni then echo stahuju update git stash git pull npm i --omit=dev tsc >/dev/null unset posel else echo exit code byl $? posel=1 casy[$i]=$(date +"%s") posledni=$(($((casy[$i]))-$cas)) if (($i < 3)) || (($((casy[$(($i - 3))])) < $(($((casy[$i])) - 864000)))) then echo Poslo to dostatecne malo, restartuju else echo Poslo to moc, seru na to echo osel$(date +"%s") >> zaznamy.dlog break fi i=$(($i+1)) fi done