X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Frouter.pm;h=648a4372b3b51649337c17cbb50d81d278edf37b;hp=07b5b9edb1c4eb9bbf9af108ad19da8bc43504f1;hb=af21dde2210a7584837d9bcc6bb8a43599a9b768;hpb=193118008312797e8188145138c6875ba506ff33 diff --git a/FS/FS/part_export/router.pm b/FS/FS/part_export/router.pm index 07b5b9edb..648a4372b 100644 --- a/FS/FS/part_export/router.pm +++ b/FS/FS/part_export/router.pm @@ -31,12 +31,33 @@ The export itself needs the following options: =cut -use vars qw(@ISA @saltset); +use vars qw(@ISA %info @saltset); +use Tie::IxHash; use String::ShellQuote; use FS::part_export; @ISA = qw(FS::part_export); +tie my %options, 'Tie::IxHash', + 'protocol' => { + label=>'Protocol', + type =>'select', + options => [qw(telnet ssh)], + default => 'telnet'}, + 'insert' => {label=>'Insert command', default=>'' }, + 'delete' => {label=>'Delete command', default=>'' }, + 'replace' => {label=>'Replace command', default=>'' }, + 'Timeout' => {label=>'Time to wait for prompt', default=>'20' }, + 'Prompt' => {label=>'Prompt string', default=>'#' } +; + +%info = ( + 'svc' => 'svc_broadband', + 'desc' => 'Send a command to a router.', + 'options' => \%options, + 'notes' => 'Installation of Net::Telnet from CPAN is required for telnet connections. ( more detailed description from Kristian / fire2wire? )', +); + @saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' ); sub rebless { shift; } @@ -143,7 +164,8 @@ sub ssh_cmd { #subroutine, not method } sub telnet_cmd { - use Net::Telnet; + eval 'use Net::Telnet;'; + die $@ if $@; warn join(', ', @_); @@ -164,3 +186,5 @@ sub telnet_cmd { #sub router_delete { #subroutine, not method #} +1; +