trying to fix the empty string dj

This commit is contained in:
Ben Harris 2018-10-26 19:16:50 -04:00
parent fcf48a3ca0
commit 9f5ac054ef
1 changed files with 7 additions and 3 deletions

10
bot.sh
View File

@ -2,17 +2,21 @@
. bot.properties
input=".bot.cfg"
now_playing=$(<$now_playing_file)
dj=$(parse_dj)
echo "Starting session: $(date "+[%y:%m:%d %T]")">$log
echo "NICK $nick" > $input
echo "USER $user" >> $input
echo "JOIN #$channel" >> $input
function parse_dj {
echo $now_playing | grep -Eo '^\([^)]*\)' | sed 's/[()]//g'
echo $now_playing \
| grep -Eo '^\([^)]*\)' \
| sed 's/[()]//g' \
| xargs
}
now_playing=$(<$now_playing_file)
dj=$(parse_dj)
tail -f $input | telnet $server $port | while read res
do
# log the session