Check, if git is available, before trying to update the client
authorHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
Wed, 2 Nov 2016 22:43:28 +0000 (23:43 +0100)
committerHeiko Schlittermann <hs@schlittermann.de>
Wed, 2 Nov 2016 22:44:02 +0000 (23:44 +0100)
run_cron

index caadf4bc5f2f5aa562e9e8d75d975c3e9d7dbd4e..278084e2cc788cea9b714351290022732744af56 100755 (executable)
--- a/run_cron
+++ b/run_cron
@@ -11,7 +11,8 @@ chdir $Bin or die "$0: Can't chdir '$Bin': $!\n";
 # client installation. FIXME: What to do, if we have
 # a 'detached' .git?
 if (-d '.git') {
-    my ($git) = grep { -x } map { "$_/git" } split /:/, $ENV{PATH};
+    die "$0: found .git dir, but git is not available\n"
+        if not grep { -x } map { "$_/git" } split /:/, $ENV{PATH};
     system('git pull >/dev/null') == 0 or die $? >> 8;
 }