forked from tilderadio/radiobot
trying to fix the empty string dj
This commit is contained in:
parent
fcf48a3ca0
commit
9f5ac054ef
10
bot.sh
10
bot.sh
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue