summaryrefslogtreecommitdiffstats
path: root/jabberwall.pl
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-01-18 18:00:15 +0100
committerFlorian Pritz <bluewind@xinu.at>2012-01-18 18:00:15 +0100
commit707ed8fac6473124d3bd13a5a12fc3cfff6aebe0 (patch)
tree1b1a37c5ab438e3d1d81003c25e4a9ea3bfe93c2 /jabberwall.pl
parentb9bb6c9ac6ca2246f30733d7c26d57ff97c91edb (diff)
downloadbin-707ed8fac6473124d3bd13a5a12fc3cfff6aebe0.tar.gz
bin-707ed8fac6473124d3bd13a5a12fc3cfff6aebe0.tar.xz
add notify-reboot and notify-users; change jabberwall to send messages
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'jabberwall.pl')
-rwxr-xr-xjabberwall.pl15
1 files changed, 6 insertions, 9 deletions
diff --git a/jabberwall.pl b/jabberwall.pl
index c8c4897..e590d6d 100755
--- a/jabberwall.pl
+++ b/jabberwall.pl
@@ -10,8 +10,8 @@ use Data::Dumper;
# options are: server, port, username, password, ressource
# location: ~/.jabberwallrc
-if(@ARGV != 1) {
- print "usage: ", basename($0), " <userlist>\n";
+if(@ARGV != 3) {
+ print "usage: ", basename($0), " <userlist> <subject> <body>\n";
exit 1;
}
@@ -38,20 +38,17 @@ if ($result[0] ne "ok") {
die "Jabber auth error: @result\n";
}
-my $body = '';
-while (<STDIN>) {
- $body .= $_;
-}
-chomp($body);
+chomp(my $subject = $ARGV[1]);
+my $body = $ARGV[2];
for my $to (@recipients) {
chomp $to;
next if ($to eq "");
$clnt->MessageSend(to=>$to,
- subject=>"",
+ subject=>$subject,
body=>$body,
- type=>"chat",
+ type=>"message",
priority=>0);
}