projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a5242cf
)
cleanup
author
Mark Wells
<mark@freeside.biz>
Mon, 26 Sep 2016 22:34:42 +0000
(15:34 -0700)
committer
Mark Wells
<mark@freeside.biz>
Tue, 27 Sep 2016 17:18:19 +0000
(10:18 -0700)
FS/bin/freeside-pingd
patch
|
blob
|
history
diff --git
a/FS/bin/freeside-pingd
b/FS/bin/freeside-pingd
index
9141e5f
..
8cfb26a
100644
(file)
--- a/
FS/bin/freeside-pingd
+++ b/
FS/bin/freeside-pingd
@@
-2,10
+2,10
@@
use strict;
use FS::Daemon ':all';
use strict;
use FS::Daemon ':all';
-use FS::Misc::Getopt;
use FS::UID qw(dbh adminsuidsetup);
use FS::Record qw( dbh qsearch qsearchs );
use FS::addr_status;
use FS::UID qw(dbh adminsuidsetup);
use FS::Record qw( dbh qsearch qsearchs );
use FS::addr_status;
+use Getopt::Std;
use Net::Ping;
my @TARGETS = (
use Net::Ping;
my @TARGETS = (
@@
-21,7
+21,8
@@
my $timeout = 5.0; # seconds
# maybe useful opts: interface, protocol, packet size, no-fork
our %opt;
# maybe useful opts: interface, protocol, packet size, no-fork
our %opt;
-getopts('vxi:');
+getopts('vxi:', \%opt);
+my $user = shift or die usage();
if (!$opt{x}) {
daemonize1('freeside-pingd');
if (!$opt{x}) {
daemonize1('freeside-pingd');
@@
-33,7
+34,11
@@
if ($opt{i}) {
$interval = $opt{i};
}
$interval = $opt{i};
}
-adminsuidsetup($opt{user});
+sub debug {
+ warn(@_, "\n") if $opt{v};
+}
+
+adminsuidsetup($user);
$FS::UID::AutoCommit = 1;
while(1) {
$FS::UID::AutoCommit = 1;
while(1) {
@@
-111,3
+116,9
@@
sub scan {
}
}
}
}
+sub usage {
+ "Usage:
+ freeside-pingd [ -i INTERVAL ] [ -v ] [ -x ] <username>
+";
+}
+