pandorafms/pandora_server/util/udp_client.pl

15 lines
403 B
Perl
Raw Normal View History

#!/usr/bin/perl
2020-11-27 13:52:35 +01:00
# Copyright (c) 2007-2021 Artica Soluciones Tecnologicas S.L.
use strict;
use IO::Socket;
if ($#ARGV != 2) {
die "Usage: $0 <address> <port> <command>";
}
my $socket = new IO::Socket::INET(Proto => "udp",
PeerAddr => $ARGV[0],
PeerPort => $ARGV[1]) || die "[error] Connect error: $@";
$socket->send ($ARGV[2]) || die "[error] Send error: $@";