V6evalRemote - Perl interface to control NUT via serial line. <Default> <Descriptions> ----------- ----------------------- -t<target_type> kame-freebsd kame-freebsd hitachi-nr60 nec-libra nec-libra-utcpip yamaha-ws-one -T<cu_command_path> cu cu command path -d<serial_device_name> cuaa0c see cu(1) -u<user_name> root user name -p<password> v6eval user password -U<login_prompt> 'ogin: ' Regular-expression -P<password_prompt> 'assword:' Reqular-expression -C<command_prompt> '(#|\$|%|>) ' Reqular-expression -v<debug level> 0 $Expect::Debug -i<internal debug level> 0 $Expect::Exp_Internal -o<stdout> 0 $Expect::Log_Stdout -V N/A enable other debug messages -s<interval> 0 send speed (sec.) -l{0,1} 0 enable rLogout() -h N/A show this message Open the remote control program. sub rOpen()

RETURN VALUES
undef: error Otherwise: Expect handle Log into the target machine. sub rLogin($) { my ( $timeout # timeout sec. )=@_;

RETURN VALUES
==0: error !=0: success Execute a command. sub rCommand($$) { my ( $command # command $timeout # timeout sec. )=@_;

RETURN VALUES
==0: error ==1: success: command exit status is 0 ==2: warning: command exit status isn't 0 ==3: warning: command exit status unknown Reboot the target machine. The functin return when getting login prompt. sub rReboot($) { my ( $timeout # timeout sec. )=@_;

RETURN VALUES
==0: error !=0: success Reboot the target machine. The function return immediately when executing reboot command. sub rRebootAsync($) { my ( $timeout # timeout sec. )=@_;

RETURN VALUES
==0: error !=0: success Copy a local file to a remote file. sub rPutfile($$$) { my ( $from, $to, $timeout, )=@_;

RETURN VALUES
==0: error !=0: success Log out of the target machine. sub rLogout($) { my ( $timeout # timeout sec. )=@_;

RETURN VALUES
==0: error !=0: success Terminate the remote control program. sub rClose($) { my ( $timeout # timeout sec. )=@_;

RETURN VALUES
==0: error !=0: success Set/get a target machine type. sub rType(;$)

RETURN VALUES
Returns a target machine type. Set/get serial device name. sub rDevice(;$)

RETURN VALUES
Returns serial device name. Set/get user name. sub rUser(;$)

RETURN VALUES
Returns user name. Set/get user prompt. sub rUserPrompt(;$)

RETURN VALUES
Returns user prompt. Set/get password prompt. sub rPasswordPrompt(;$)

RETURN VALUES
Returns password prompt. Set/get command prompt. sub rCommandPrompt(;$)

RETURN VALUES
Returns command prompt. Set/get Expect.pm's debug() sub rDebug(;$)

RETURN VALUES
Returns $Remote->debug(). Set/get Expect.pm's exp_internal() sub rExpInternal(;$)

RETURN VALUES
Returns $Remote->exp_internal() Set/get Expect.pm's log_stdout() sub rLogStdout(;$)

RETURN VALUES
Returns $Remote->log_stdout() Set/get interval that characters are sent at. sub rRemoteSpeed(;$)

RETURN VALUES
Returns interval value. Enable(!=0)/Desable(==0, default) rLogout() sub rEnableLogout(;$)

RETURN VALUES
Returns previous value #!/usr/bin/perl use V6evalRemote; print "Open remote\n"; rOpen() || exit $V6evalRemote::exitFail; $type=rType(); $rOpt_timeout=5 if (!defined $rOpt_timeout); if($type eq "kame-freebsd") { print "Login\n"; rLogin($rOpt_timeout) || exit $V6evalRemote::exitFail; print "List dir\n"; rCommand("ls -a", $rOpt_timeout) || exit $V6evalRemote::exitFail; print "Logout\n"; rLogout($rOpt_timeout) || exit $V6evalRemote::exitFail; } else { print "List dir of NUT($type) manually, ". "then press enter key.\n"; <STDIN>; } print "Close remote\n"; rClose(); exit $V6evalRemote::exitPass; Expect.pm Stty.pm Pty.pm