Skip to content

Instantly share code, notes, and snippets.

@SamEureka
Created October 24, 2017 15:45
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 SamEureka/dc0e72526602fce2b73b60718268e9c7 to your computer and use it in GitHub Desktop.
Save SamEureka/dc0e72526602fce2b73b60718268e9c7 to your computer and use it in GitHub Desktop.
work in progress start script
#!/bin/bash
# SAMPLE1='1-first.with.custom.name'
# SAMPLE2='2-second.with.custom.name'
# for (( i = 1; i <= 2; i++ ))
# do
# var="SAMPLE$i"
# echo ${!var}
# done
# Check to see if beyond is runing
list=(`screen -list |grep -o '[a-z]\{10\}'`)
for ((i=0; i<${#list[@]}; i++)); do
work=$list[$i]
echo ${!work}
# if ! [[ -z `screen -list |grep $list[$i]` ]]
# then
# echo "${list[$i]} is not running."
# else
# echo "${list[$i]} is shutting down."
# screen -S {$list[$i]} -p 0 -X stuff "stop$(printf \\r)" &
# while [[ -z `screen -list |grep $list[$i]` ]]
# do
# echo -n "."
# done
# fi
done
# beyond=`screen -list | grep beyond`
#if ! [[ -z $listing ]]
#then
# echo $listing " is running..."
#else
# echo $listing " is not running..."
# screen -S $listing -p 0 -X stuff "stop$(printf \\r)" &&
# sleep 10
# beyond=`screen -list | grep beyond`
# if [[ -z $beyond ]]
# then
# echo "FTB Beyond has shutdown!"
# else
# echo "Trying to shut this shit down again..."
# screen -S beyond -p 0 -X stuff "stop$(printf \\r)"
# sleep 30
# beyond=`screen -list | grep beyond`
# if [[ -z $beyond ]]
# then
# echo "Geesus... it finally shutdown properly."
# else
# echo "Something ain\'t right here... try \'sudo reboot\' or \'kill\'"
# fi
# fi
#fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment