Taking a guess here - did you create the file on a windows machine? (or ftp in ascii mode?)
you probably need to run:
dos2unix dyndns.sh
chmod 755 dyndns
then try again
Hi All,
I am using the HowTo:PasswordProtectedRemoteAccess and I have created the file dyndns.sh, placed it in the /var/hack directory and made it executable.
When I try to test it I get:
[TiVo [p0] ~]# ./dyndns.sh
bash: ./dyndns.sh: No such file or directory
[TiVo [p0] ~]#
I get the same if I put in the path:
[TiVo [p0] /]# /var/hack/dyndns.sh
bash: /var/hack/dyndns.sh: No such file or directory
[TiVo [p0] /]# cd /var/hack
[TiVo [p0] /var/hack]# dyndns.sh
bash: dyndns.sh: command not found
The file is there and the permissions are OK.
[TiVo [p0] ~]# find /var/hack/dyndns.sh
/var/hack/dyndns.sh
[TiVo [p0] ~]# cd /var/hack
[TiVo [p0] /var/hack]# ls -l dyndns.sh
-rwxr-xr-x 1 0 0 854 May 2 10:32 dyndns.sh
The first line of the file is: #!/bin/sh
so I don't think that's the problem.
To create the file I simply copied & pasted from the HowTo to a new file in xint. I modified the Host Name etc and saved it as dyndns.sh
I am not very experienced in Linux so I would be grateful if anyone could point out the error of my ways!
Regards
Mike Sharkey
Phillips Series 1 Tivo running v.1.5 Image
Taking a guess here - did you create the file on a windows machine? (or ftp in ascii mode?)
you probably need to run:
dos2unix dyndns.sh
chmod 755 dyndns
then try again
You are spot on....I did create the file on a Windows PC, so I did what you suggested and I got the file to execute. Thank you for that.
I found I had to change some of the paths in the file location section of dyndns.sh (/devbin instead of /hack/bin).
Now I get to the part where it's supposed to get my IP address and it falls over.
[TiVo [p0] /var/hack]# /var/hack/dyndns.sh
--13:34:44-- http://www.myipaddress.com/
=> `index.html'
Resolving www.myipaddress.com... failed: Host not found.
grep: index.html: No such file or directory
rm: indexhtml: No such file or directory
/bin/cat: /tmp/ip.txt: No such file or directory
I don't believe the router (Netcomm NB1300PLUS4) is a problem as the Tivo makes the daily call OK.
Any thoughts?
It looks to me like you don't have a nameserver setup on your tivo. Either edit /etc/resolv.conf and add your ISPs nameserver or change the dyndns.sh script to use the ip address of www.myipaddress.com instead of the host name.
My /etc/resolv.conf contains:
Code:# Example resolv.conf file # ns.optus.net.au: nameserver 61.88.88.88
Thanks Matt, you were right. I edited the dyndns.sh file replacing the Host Name with the IP address (although I had to go away from www.myipaddress.com as they seem to have introduced a security feature which prevented the script working). Anyway I used http://checkip.dyndns.com (204.13.249.51) and it worked......up to a point!
There was another Host Name in the script (http://members.dyndns.org/nic etc) which it uses to update the IP database. When I set about trying to find the IP address for this site I came across an announcement from dyndns.com dated April 2003 to the effect that members 'NIC' was being retired.
"For the forseeable future, links within members.dyndns.org will be automatically redirected to the new locations within www.dyndns.org, but please be sure to update any bookmarks pointing to members.dyndns.org appropriately. Update clients should continue to use members.dyndns.org, not www.dyndns.org, to perform updates." (http://www.dyndns.com/news/releases/...c_retired.html)
So now I'm stumped again!
As before, grateful for any suggestions
According to the the Dyndns API https://www.dyndns.com/developers/specs/syntax.html , members.dyndns.org is the correct host to use.
What problems are you seeing now?
I would recommend at this stage that you update /etc/resolv.conf to contain a valid nameserver. To do this enter the following commands on the tivo (you can copy and paste everything inside the blue box)
Please post the output of the above commandsCode:rw cp /etc/resolv.conf /etc/resolv.conf.bak echo "nameserver 61.88.88.88" >> /etc/resolv.conf ro cat /etc/resolv.conf ls -l /etc/resolv.conf*
All is well!
I should have read your first post more carefully, Matt.
I followed your first suggestion and edited the resolv.conf file to include the Bigpond nameserver and the script worked perfectly (including the www.myipaddress.com lookup)
I have put the line 15,45 * * * * /var/hack/dyndns.sh into /hack/etc/crontab..............I presume that's the place for it?
Thanks for all your help
I just checked the execution again and I noticed it ran the full script even though my IP address had not changed.
Looks to me as if the comparison of old and current IP is not working.
Is there a way that I can check the value of OLDIP=`$CAT $CACHE`?
Assuming your using the script from the wiki
You may also like to tryCode:cat /tmp/ip.txt
which will show the output of each command as it's runCode:sh -x ./dyndns.sh
Bookmarks