summaryrefslogtreecommitdiff
path: root/loadbars.pl
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2010-11-14 10:13:41 +0000
committerPaul Buetow <paul@buetow.org>2010-11-14 10:13:41 +0000
commit31e734c2ec1ba01e940622a8ec0f487522879b18 (patch)
tree5491111f51d88f22205c069fec34f328a3c589f9 /loadbars.pl
parentf9e157a152685903631dc5e918f22c698143645c (diff)
added ssh agent support
set sshs -o StrictHostKeyChecking to no
Diffstat (limited to 'loadbars.pl')
-rwxr-xr-xloadbars.pl17
1 files changed, 12 insertions, 5 deletions
diff --git a/loadbars.pl b/loadbars.pl
index 8aa0aa6..14a928b 100755
--- a/loadbars.pl
+++ b/loadbars.pl
@@ -51,7 +51,7 @@ use threads::shared;
use constant {
DEPTH => 8,
PROMPT => 'loadbars> ',
- VERSION => 'loadbars v0.0.3',
+ VERSION => 'loadbars v0.0.4',
COPYRIGHT => '2010 (c) Paul Buetow <loadbars@mx.buetow.org>',
NULL => 0,
MSG_SET_DIMENSION => 1,
@@ -101,7 +101,7 @@ sub thr_get_stat ($) {
my $host = shift;
my $bash = "if [ -e /proc/stat ]; then proc=/proc/stat; else proc=/usr/compat/linux/proc/stat; fi; for i in \$(seq $CONF{samples}); do cat \$proc; sleep 0.1; done";
- my $cmd = $host eq 'localhost' ? $bash : "ssh $CONF{sshopts} $host '$bash'";
+ my $cmd = $host eq 'localhost' ? $bash : "ssh -o StrictHostKeyChecking=no $CONF{sshopts} $host '$bash'";
my $sigusr1 = 0;
loop {
@@ -511,12 +511,19 @@ sub dispatch_table () {
}
sub main () {
- my ($hosts, $dispatch) = dispatch_table;
+ my ($hosts, $dispatch) = dispatch_table;
GetOptions ($dispatch->('options'));
+ set_toggle_regexp;
my @hosts = split ',', $$hosts;
- @hosts = 'localhost' unless @hosts;
- set_toggle_regexp;
+
+ if (@hosts) {
+ system 'ssh-add';
+
+ } else {
+ @hosts = 'localhost';
+ }
+
my ($display, @threads) = create_threads @hosts;
my $term = new Term::ReadLine VERSION;