projects
/
dell-switch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fd8d66e
)
added some sleeps to help slow switches
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 9 Jun 2016 07:39:50 +0000
(09:39 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 9 Jun 2016 07:39:50 +0000
(09:39 +0200)
dell-switch.pl
patch
|
blob
|
history
diff --git
a/dell-switch.pl
b/dell-switch.pl
index
edcdcf5
..
a27ec95
100755
(executable)
--- a/
dell-switch.pl
+++ b/
dell-switch.pl
@@
-36,6
+36,8
@@
sub send_pty {
print STDERR "[$_]" if $debug;
syswrite $pty, $_;
# $pty->flush;
+ sleep 0.05;
+
sysread $pty, my $echo, 1;
print STDERR $echo;
$buff .= $echo;
@@
-94,8
+96,10
@@
while(1) {
} elsif ( $buff =~ m/% Unrecognized command/ ) {
exit 1;
} elsif ( $buff =~ s{More: <space>, Quit: q.*One line: <return> }{} ) {
+ sleep 0.5;
send_pty " ";
} elsif ( $buff =~ s{\Q--More-- or (q)uit\E}{} ) {
+ sleep 0.5;
send_pty " "
} elsif ( $buff =~ s{\e\[0m\r\s+\r}{} ) {
}