diff --git a/utils/git.php b/utils/git.php index 5f2c08123..1bc862dcf 100644 --- a/utils/git.php +++ b/utils/git.php @@ -12,17 +12,19 @@ else if(flock($tfile, LOCK_EX | LOCK_NB)) { $token = trim(fgets($tfile)); - + // check to make sure that the token value is correct if(array_key_exists('token', $_GET) and $token === $_GET['token']) { // perform a git pull chdir('..'); $gitdir = getcwd() . "/.git"; - system("git --git-dir $gitdir pull"); - - echo 'git update successful'; - + $last_line = system("git --git-dir $gitdir pull", $last_line); + + echo 'git pull last line: ' . $last_line . "\n"; + echo 'git pull retval: ' . $retval . "\n"; + echo 'git pull complete'; + // Sleep for 5 seconds to throttle the update rate to 12 per minute sleep(5); } @@ -31,11 +33,11 @@ echo 'ERROR: Invalid secret token provided. ' . 'See the README for more information.'; } - + // Release the lock file flock($tfile, LOCK_UN); // release the lock } -else +else { echo 'ERROR: An update is currently being performed, ' . 'this request has been rejected.';