summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@iki.fi>2005-09-06 19:16:44 +0200
committerNiko Tyni <ntyni@iki.fi>2005-09-06 19:16:44 +0200
commit46af3fd04bfb97a53ffb1a67b74eeb8ba2d2ee74 (patch)
treec4c003069eaf032cc71b507daa5a95411e5743bd /lib
parentdec26a16f5abcc9db5770b35d12c9b969b5c84d7 (diff)
downloadsmokeping-46af3fd04bfb97a53ffb1a67b74eeb8ba2d2ee74.tar.gz
smokeping-46af3fd04bfb97a53ffb1a67b74eeb8ba2d2ee74.tar.xz
* trunk:lib/Smokeping.pm
+ regenerate the logo images if Smokeping.pm is newer than the old ones
Diffstat (limited to 'lib')
-rw-r--r--lib/Smokeping.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 0e16ef6..55583e7 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -2906,7 +2906,14 @@ KID:
sub gen_imgs ($){
my $cfg = shift;
- if (not -r $cfg->{General}{imgcache}."/rrdtool.png"){
+ my $modulemodtime;
+ for (@INC) {
+ ( -f "$_/Smokeping.pm" ) or next;
+ $modulemodtime = (stat _)[9];
+ last;
+ }
+ if (not -r $cfg->{General}{imgcache}."/rrdtool.png" or
+ (defined $modulemodtime and $modulemodtime > (stat _)[9])){
open W, ">".$cfg->{General}{imgcache}."/rrdtool.png"
or do { warn "WARNING: creating $cfg->{General}{imgcache}/rrdtool.png: $!\n"; return 0 };
print W unpack ('u', <<'UUENC');
@@ -3001,7 +3008,8 @@ UUENC
close W;
}
- if (not -r $cfg->{General}{imgcache}."/smokeping.png"){
+ if (not -r $cfg->{General}{imgcache}."/smokeping.png" or
+ (defined $modulemodtime and $modulemodtime > (stat _)[9])){
open W, ">".$cfg->{General}{imgcache}."/smokeping.png"
or do { warn "WARNING: creating $cfg->{General}{imgcache}/smokeping.png: $!\n"; return 0};
print W unpack ('u', <<'UUENC');