chiark / gitweb /
New notification mechanism 'userv'.
[post-pizza-notify.git] / via-userv
diff --git a/via-userv b/via-userv
new file mode 100755 (executable)
index 0000000..dbfd8b9
--- /dev/null
+++ b/via-userv
@@ -0,0 +1,15 @@
+#!/usr/bin/perl -w
+#
+# recipient format:
+#    userv HOST USER SERVICE
+
+use strict;
+die unless @ARGV==4;
+our ($msg,$host,$user,$service) = @ARGV;
+
+if (open PIPE, "|-", "ssh", $host, "userv", "-t", "2", $user, $service) {
+    print PIPE "$msg\n";
+    close PIPE;
+}
+
+die $! if $? != 0;