Hi Andrew....
Your message made me have a look around, http://pancho.lunarmedia.net/howto.shtml is what I cam up with, I've just tried it on a 1750, 2621, 3662 works a treat... I know what I'll be doing on Monday, getting rid of my expect scripts
Simon
On Friday 03 May 2002 6:45 pm, Andrew Wallis 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!