File: check_two_way.pl

package info (click to toggle)
libnet-snpp-perl 1.17-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 208 kB
  • sloc: perl: 872; makefile: 6
file content (24 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/local/bin/perl -w
use strict;
use Net::SNPP;

die "I need two arguments!" if ( @ARGV != 2 );

# should be two arguments that are digits
my( $message_tag, $message_pin ) = @ARGV;

#my $snpp_server = Net::SNPP->new( 'snpp.nextel.com' );
my $snpp_server = Net::SNPP->new( 'localhost', Port => 11444 )
    || die "could not connect to SNPP server!";
#$snpp_server->debug(10);

my @status = $snpp_server->message_status( $message_tag, $message_pin );

print <<EOTXT;
   Message $message_tag $message_pin has a status of $status[4].
   Sequence number is $status[0] with timestamp $status[1]$status[2].
   The response, if any is '$status[3].'
EOTXT
$snpp_server->quit();

exit 0;