I got it running on a RH7.1 box at work updating the config on a router on the fly......... I'll see if I can dig up my notes and pass them over to you. Probably won't be till Monday though..
Have you thought about using SNMP, if I remember right it can be done, this way you'll be able to use ACL's....
Simon
On Friday 03 May 2002 6:45 pm, you wrote:
I have a shell script which runs an expect script which, in turn, connects to my router and reboots it. I've had something very like it for ages but I've had a problem ever since a recent upgrade to RH7.2.
Basically, the script works fine in the foreground; it works fine under "at now +1 minute"; it works fine under "batch" BUT it always fails when run under cron.
The relevant output from failed jobs looks like:
spawn telnet my-router Trying 192.168.0.254... Connected to my-router. Escape character is '^]'.
Password: Connection closed by foreign host. send: spawn id exp3 not open while executing "exp_send -s -- $arg" (procedure "send" line 3) invoked from within "send -- "X"" (file "/usr/local/sbin/reboot_router.exp" line 53)
which seems to show that the telnet session is spawned OK and opens the connection (the "Password: " string comes from the router) but then as soon as expect tries to send the first character of the password, it finds that the telnet session has been closed!
Any ideas, please?
PS. Yes, I know all of the security risks in embedding passwords in scripts and in using telnet rather than ssh!
Regards
Andrew Wallis Fox Cottage Fox Hill St Cross South Elmham HARLESTON IP20 0NX UK
tel: +44 (0)1986 782283 mobile: +44 (0)7860 217025 SMS via email: mailto: +447860217025@mmail.co.uk
main@lists.alug.org.uk http://www.anglian.lug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!