- # Read "bot:" line, start bot screen session from it if not yet existing,
- # set up irclogs dir if not yet existing.
- if [ "${first_word}" = "bot:" ]; then
- session_name=$(echo -n "${line}" | cut -d' ' -f2)
- bot_name=$(echo -n "${line}" | cut -d' ' -f3)
- channel_name=$(echo -n "${line}" | cut -d' ' -f4)
- server_name=$(echo -n "${line}" | cut -d' ' -f5)
- set +e
- screen -S "${session_name}" -Q select . > /dev/null
- start_screen=$?
- set -e
- if [ "${start_screen}" -eq "1" ]; then
+ # Read "bot:" line, start bot screen session from it if not yet existing,
+ # set up irclogs dir if not yet existing.
+ if [ "${first_word}" = "bot:" ]; then
+ session_name=$(echo -n "${line}" | cut -d' ' -f2)
+ bot_name=$(echo -n "${line}" | cut -d' ' -f3)
+ channel_name=$(echo -n "${line}" | cut -d' ' -f4)
+ shortened_channel_name="${channel_name}"
+ first_char=$(echo -n "${channel_name}" | cut -c1)
+ if [ "${first_char}" = "#" ]; then
+ shortened_channel_name=$(echo -n "${channel_name}" | cut -c2-)
+ fi
+ server_name=$(echo -n "${line}" | cut -d' ' -f5)
+ login_user=$(echo -n "${line}" | cut -d' ' -f6)
+ login_pw=$(echo -n "${line}" | cut -d' ' -f7)
+ set +e
+ screen -S "${session_name}" -Q select . > /dev/null
+ start_screen=$?
+ set -e
+ if [ "${start_screen}" -eq "1" ]; then