summaryrefslogtreecommitdiff
path: root/lib/App/smsg/Command/Status.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/App/smsg/Command/Status.pm')
-rw-r--r--lib/App/smsg/Command/Status.pm56
1 files changed, 56 insertions, 0 deletions
diff --git a/lib/App/smsg/Command/Status.pm b/lib/App/smsg/Command/Status.pm
new file mode 100644
index 0000000..019cd5b
--- /dev/null
+++ b/lib/App/smsg/Command/Status.pm
@@ -0,0 +1,56 @@
+package App::smsg::Command::Status;
+
+use 5.010;
+use strict;
+use warnings;
+use utf8;
+
+BEGIN {
+ $App::smsg::Command::Status::AUTHORITY = 'https://dr.jones.dk/me#me';
+ $App::smsg::Command::Status::VERSION = '0.001';
+}
+
+use App::smsg -command;
+use namespace::clean;
+
+use NetSDS::Kannel;
+#use Coro;
+
+use constant abstract => q (Check status of platform(s).);
+use constant usage_desc => '%c status %o <platform>...';
+use constant description => <<'DESCRIPTION';
+Connect to one or more platforms (Kannel, Jabber, IRC etc.) and check
+operational status.
+DESCRIPTION
+use constant opt_spec => (
+ ['kannelserver=s', "the Kannel server to connect to",
+ {default => 'localhost'}],
+ ['kannelport=i', "the Kannel port to connect to",
+ {default => 13013}],
+ ['kanneluser=s', "the Kannel users to authenticate as",
+ {default => 'tester'}],
+ ['kannelpasswd=s', "the Kannel password to authenticate with",
+ {default => 'foobar'}],
+ ['kannelsmsc=s', "the Kannel SMSC to correspond with"],
+ [],
+# [ 'verbose|v', "print extra stuff"],
+ [ 'debug', "print debug stuff"],
+);
+
+sub execute {
+ my ($self, $opt, $args) = @_;
+
+ # TODO: support overriding full URL
+ # TODO: use URI module to construct URL
+ my $kannel = NetSDS::Kannel->new(
+ sendsms_url => 'http://' . $opt->kannelserver . ':' . $opt->kannelport . '/cgi-bin/sendsms',
+ sendsms_user => $opt->kanneluser,
+ sendsms_passwd => $opt->kannelpasswd,
+ default_smsc => $opt->kannelsmsc,
+ );
+
+ die 'FIXME: unimplemented!';
+
+}
+
+1;