Guest User

Untitled

a guest
Dec 11th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Configuration files
  4. config='config.cfg'
  5. source "$config"
  6.  
  7. # If this is true, run the rest of the script in a new screen.
  8. if [ $background_loading == "true" ]; then
  9. exec screen -dmS "alt-logging" /bin/bash "$0";
  10. fi
  11.  
  12. [ $# -eq 0 ] && { echo -e "nERROR: You must specify an alt file!"; exit 1; }
  13.  
  14. # Logging script
  15. y=0
  16. while IFS='' read -r line || [[ -n "$line" ]]; do
  17. name="alt$y"
  18. echo -e "Starting alt number $y..."
  19. cmd="screen -dmS $name bash -c 'exec $line;'"
  20. eval $cmd
  21. echo -e "Successfully started alt number $y."
  22. echo -e "Waiting $logging_speed seconds..."
  23. sleep $logging_speed
  24. y=$(( $y + 1 ))
  25. done < "$1"
Add Comment
Please, Sign In to add comment