diff --git a/scripts/gpgcerts.php b/scripts/gpgcerts.php index 43537ec..84c9eab 100755 --- a/scripts/gpgcerts.php +++ b/scripts/gpgcerts.php @@ -15,6 +15,10 @@ */ include_once("../includes/mysql.php"); + $lck = fopen('/tmp/GPGlock', 'w'); + while(flock($lck, LOCK_EX) < 0) + sleep(rand(100000,200000)); + $query = "select * from `gpg` where `crt`=''"; $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) @@ -62,4 +66,7 @@ mysql_query($query); } } + + flock($lck, LOCK_UN); + fclose($lck); ?>