Can't get script to work right
Added by Jaime Lopez over 5 years ago
I have a script to grab the epg from its source but it won't work. It gives me an HTTP 401 error, it appears that it is ignoring the "&password=(password)" part of the wget command.
The Script:
"#!/bin/bash
rm /var/lib/xmltvlog/xmltv.log
rm /var/lib/epg.xml*
touch /var/lib/xmltvlog/xmltv.log
echo "Download starting..." >> /var/lib/xmltvlog/xmltv.log
echo "Time: $(date)" >> /var/lib/xmltvlog/xmltv.log
#wget -O epg.xml http://(domain).(tld):(port)/xmltv.php?username=(username)&password=(password)
cat /var/lib/epg.xml | sudo socat - UNIX-CONNECT:/var/lib/.hts/tvheadend/epggrab/xmltv.sock
echo "" >> /var/lib/xmltvlog/xmltv.log
echo "Time: $(date)" >> /var/lib/xmltvlog/xmltv.log
echo "EPG Updated successfully." >> /var/lib/xmltvlog/xmltv.log"
Replies (2)
RE: Can't get script to work right - Added by saen acro over 5 years ago
Do you need to use so many variables?
Do you try to use CURL to debug eventual errors?
wget -d -O epg.xml http://(domain).(tld):(port)/xmltv.php?username=(username)&password=(password)
RE: Can't get script to work right - Added by Hiro Protagonist over 5 years ago
Jaime Lopez wrote:
I have a script to grab the epg from its source but it won't work. It gives me an HTTP 401 error, it appears that it is ignoring the "&password=(password)" part of the wget command.
? is a shell meta-character.
Put your url in single quotes to fix this.