Date: Tue, 15 May 2001 09:05:25 +0200 From: Wim Livens <wim@livens.net> To: freebsd-isp@freebsd.org Cc: davew@sai.co.za Subject: RE: Telnet + command scripting run from crond Message-ID: <20010515090524.A26629@krijt.livens.net>
next in thread | raw e-mail | index | archive | help
Something like this works for me. Customize it to your device. Do it by hand once to see what exact prompts you need to expect. #!/usr/local/bin/expect spawn telnet your_nas expect Username: send "foo\n" expect Password: send "bar\n" expect # send "some command\n" expect # send "exit\n" interact -- Wim Livens. IP Network Engineering. C o l t B e l g i u m -----Original Message----- From: David Wilson [mailto:davew@sai.co.za] Sent: Monday, May 14, 2001 5:39 PM To: freebsd-isp@freebsd.org Cc: isp linux Subject: Telnet + command scripting run from crond Hi all, howzit going ? I'm not to good at scripting so I really need help on this: I have a USR NAS device that I need to telnet every 24 hrs and issue a command to it, how could I write a script that I could run as a cron job that would automatically login and issue the commands and then log out again ? Thanks. Any help would be greatly appreciated. Regards David Wilson Technical Support Centre The S.A Internet 0860 100 869 http://www.sai.co.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010515090524.A26629>