projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup
[freeside.git]
/
FS
/
bin
/
freeside-pingd
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>
+";
+}
+