You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
682 B
34 lines
682 B
package Mosh; |
|
|
|
use Milkbone; |
|
|
|
register_hook("signed_in", sub { |
|
register_hook("tick", sub { |
|
print "% "; |
|
my $input = <STDIN>; |
|
|
|
eval "use Milkbone::AllHooks; use base 'Milkbone::AllHooks'; $input" or print $@; |
|
}); |
|
}); |
|
|
|
register_hook("create_logon_prompt", sub { |
|
my ($user, $pass); |
|
|
|
print "Username: "; |
|
$user = <STDIN>; |
|
chomp $user; |
|
|
|
print "Password: "; |
|
system('stty -echo'); |
|
$pass = <STDIN>; |
|
system('stty echo'); |
|
chomp $pass; |
|
|
|
hook("protocol_signon", -user => $user, -pass => $pass); |
|
}); |
|
|
|
register_hook('reload_mosh', sub { reload_plugin('Mosh'); }); |
|
|
|
register_hook('msg_in', sub { |
|
print $ARGS{-msg}; |
|
});
|
|
|