Hi John, yes it definitely can be a bit of extra work with the nix based systems. Especially with Synology OS. It adds just that little bit of extra difficulty and eccentricity. If you save the larger (second) script I have above in the /usr/bin folder, then it should pop up after you reboot tvheadend in the Configuration -> Channel/EPG -> EPG Grabber Modules area.
I would however probably change both scripts a little in hindsight for Synology.
1) Create a folder/share where you will store all your scripts and won't be deleted. The reason will come later. For me let's say I have /volume2/downloads/
2) xmltv download script:
#!/bin/sh
cd /volume2/downloads/
wget http://xmltv.net/xml_files/Sydney.xml
mv Sydney.xml /volume2/downloads/tv_grab_file.xmltv
3) tvheadend EPG grabber module script:
#!/bin/bash
dflag=
vflag=
cflag=
if (( $# < 1 ))
then
cat /volume2/downloads/tv_grab_file.xmltv
exit 0
fi
for arg
do
delim=""
case "$arg" in
#translate --gnu-long-options to -g (short options)
--description) args="${args}-d ";;
--version) args="${args}-v ";;
--capabilities) args="${args}-c ";;
#pass through anything else
*) [[ "${arg:0:1}" == "-" ]] || delim="\""
args="${args}${delim}${arg}${delim} ";;
esac
done
#Reset the positional parameters to the short options
eval set -- $args
while getopts "dvc" option
do
case $option in
d) dflag=1;;
v) vflag=1;;
c) cflag=1;;
\?) printf "unknown option: -%s\n" $OPTARG
printf "Usage: %s: [--description] [--version] [--capabilities] \n" $(basename $0)
exit 2
;;
esac >&2
done
if [ "$dflag" ]
then
printf "tv_grab_file is a simple grabber that just read the ~/.xmltv/tv_grab_file.xmltv file\n"
fi
if [ "$vflag" ]
then
printf "0.1\n"
fi
if [ "$cflag" ]
then
printf "baseline\n"
fi
exit 0
Instead of crontab, for the first script, I also saved it in the /volume2/downloads/ folder and then just added a daily task in Synology to run that script. (Control Panel -> Task Scheduler -> Create scheduled task -> User defined script).
Regarding the second script, the EPG grabber module one, that needs to be saved in /usr/bin/ for it to be recognised. Once it is saved in that folder, then you reboot tvheadend and it should pop up. However, this is the annoying part. As soon as Synology updates the DSM, it wipes all files in /usr/bin/. So, I save that second script also in /volume2/downloads/ and you can either just copy it across after the DSM update, or also set up a second script to copy it from /volume2/downloads/ to /usr/bin/ on some type of regular time frame.
Hopefully this makes sense. If not, I can start from scratch and type out the whole lot of instructions in a longer version. I may not be until the weekend though... Good luck.