Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Configuration files
- config='config.cfg'
- source "$config"
- # If this is true, run the rest of the script in a new screen.
- if [ $background_loading == "true" ]; then
- exec screen -dmS "alt-logging" /bin/bash "$0";
- fi
- [ $# -eq 0 ] && { echo -e "nERROR: You must specify an alt file!"; exit 1; }
- # Logging script
- y=0
- while IFS='' read -r line || [[ -n "$line" ]]; do
- name="alt$y"
- echo -e "Starting alt number $y..."
- cmd="screen -dmS $name bash -c 'exec $line;'"
- eval $cmd
- echo -e "Successfully started alt number $y."
- echo -e "Waiting $logging_speed seconds..."
- sleep $logging_speed
- y=$(( $y + 1 ))
- done < "$1"
Add Comment
Please, Sign In to add comment