summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-15 17:40:21 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-15 17:40:21 +0200
commitf8d45bbe9eacbcfcea91f0d34fe972b37db36da4 (patch)
tree1a7a41a71810406f5e82a394d0b6559aacd54937
parent00e313d7e9fc487b445b05324148a8931941b8f0 (diff)
downloadfastd-f8d45bbe9eacbcfcea91f0d34fe972b37db36da4.tar
fastd-f8d45bbe9eacbcfcea91f0d34fe972b37db36da4.zip
Add status.pl example script
-rwxr-xr-xdoc/examples/status.pl17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/examples/status.pl b/doc/examples/status.pl
new file mode 100755
index 0000000..11cea0d
--- /dev/null
+++ b/doc/examples/status.pl
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use IO::Socket::UNIX qw( SOCK_STREAM );
+
+$ARGV[0] or die("Usage: status.pl <socket>\n");
+
+my $socket = IO::Socket::UNIX->new(
+ Type => SOCK_STREAM,
+ Peer => $ARGV[0],
+)
+ or die("Can't connect to server: $!\n");
+
+foreach my $line (<$socket>) {
+ print $line;
+}