Ich würde das Skript mit Perl schreiben... (DIE Sprache für Linux-Admins)
Mit den vorhandenen Modulen sollte das ein Kinderspiel sein!
Hier das passende Modul:
http://search.cpan.org/author/JROGERS/Ne…b/Net/Telnet.pm
Und hier wie man es verwendet, also wirklich easy:
|
Quellcode
|
1
2
3
4
5
6
7
|
use Net::Telnet ();
$t = new Net::Telnet (Timeout => 10,
Prompt => '/bash\$ $/');
$t->open("sparky");
$t->login($username, $passwd);
@lines = $t->cmd("who");
print @lines;
|
Wenn du jetzt noch das Skript in das Verzeichniss /etc/cron.hourly/ kopierst wird es stündlich ausgeführt!
Have Phun!