whoops - updated version number and added monitor-version to syncoid as well
This commit is contained in:
parent
bc3e3140a5
commit
c6a5aad2aa
21
syncoid
21
syncoid
|
@ -4,18 +4,22 @@
|
||||||
# from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this
|
# from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this
|
||||||
# project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE.
|
# project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE.
|
||||||
|
|
||||||
my $version = '1.0.8';
|
my $version = '1.0.10';
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
use Time::Local;
|
use Time::Local;
|
||||||
use Sys::Hostname;
|
use Sys::Hostname;
|
||||||
|
use LWP::Simple;
|
||||||
|
|
||||||
my %args = getargs(@ARGV);
|
my %args = getargs(@ARGV);
|
||||||
|
|
||||||
if ($args{'version'}) {
|
if ($args{'version'}) {
|
||||||
print "Syncoid version: $version\n";
|
print "Syncoid version: $version\n";
|
||||||
exit 0;
|
exit 0;
|
||||||
|
} elsif ($args{'monitor-version'}) {
|
||||||
|
monitor_version();
|
||||||
|
exit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $rawsourcefs = $args{'source'};
|
my $rawsourcefs = $args{'source'};
|
||||||
|
@ -165,11 +169,24 @@ exit;
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
sub monitor_version() {
|
||||||
|
my $trunkversion = get("https://raw.githubusercontent.com/jimsalterjrs/sanoid/master/VERSION");
|
||||||
|
chomp $trunkversion;
|
||||||
|
if ($version eq $trunkversion) {
|
||||||
|
print "OK: local version $version matches trunk version $trunkversion\n";
|
||||||
|
exit 0;
|
||||||
|
} else {
|
||||||
|
print "WARN: local version $version does not match trunk version $trunkversion\n";
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub getargs {
|
sub getargs {
|
||||||
my @args = @_;
|
my @args = @_;
|
||||||
my %args;
|
my %args;
|
||||||
|
|
||||||
my $novalueargs = ",debug,nocommandchecks,version,";
|
my $novalueargs = ",debug,nocommandchecks,version,monitor-version,";
|
||||||
|
|
||||||
while (my $arg = shift(@args)) {
|
while (my $arg = shift(@args)) {
|
||||||
if ($arg =~ /^--/) {
|
if ($arg =~ /^--/) {
|
||||||
|
|
Loading…
Reference in New Issue