Skip to content

Instantly share code, notes, and snippets.

@buzzkillb
Created October 26, 2019 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buzzkillb/2e3d79276c8de1c22e49af8aaed54a71 to your computer and use it in GitHub Desktop.
Save buzzkillb/2e3d79276c8de1c22e49af8aaed54a71 to your computer and use it in GitHub Desktop.
run multiple daemons and alternate them
#!/bin/bash
#chmod +x save-ram.sh
#screen -S saveram
#./save-ram.sh
#start forever loop
while true; do
#stop 10-35 and start 75-100
for ((i=10; i<36; i++))
do
echo "denarius_$i.daemon stop"
denarius_$i.daemon stop
sleep 10
done
for ((i=75; i<101; i++))
do
echo "denarius_$i.daemon"
denarius_$i.daemon
sleep 10
done
#45min timer with countdown for next loop
(for (( timer=1800; timer>0; timer--)); do
sleep 1 &
printf " $timer \r"
wait
done)
#stop 75-100 and start 10-35
for ((i=75; i<101; i++))
do
echo "denarius_$i.daemon stop"
denarius_$i.daemon stop
sleep 10
done
for ((i=10; i<36; i++))
do
sleep 10
echo "denarius_$i.daemon"
denarius_$i.daemon
done
#45min timer with countdown for next loop
(for (( timertimer=1800; timertimer>0; timertimer--)); do
sleep 1 &
printf " $timertimer \r"
wait
done)
#loop back to begin again
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment