X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fwait-for-connection;h=f0fd8cc60fd9fc71692490e9c682edc40b523272;hb=8357a70c4bc7a104373be2ddde6e8d918ea5721b;hp=3b4902d1c4b70c5ebd2054754caaeea71d764081;hpb=11be31d601524492ee59bf54ebab011329676e4f;p=friendica.git diff --git a/bin/wait-for-connection b/bin/wait-for-connection index 3b4902d1c4..f0fd8cc60f 100755 --- a/bin/wait-for-connection +++ b/bin/wait-for-connection @@ -1,14 +1,34 @@ #!/usr/bin/php - . + * * This script tries to connect to a database for a given interval * Useful in case of installation e.g. to wait for the database to not generate unnecessary errors * * Usage: php bin/wait-for-connection {HOST} {PORT} [{TIMEOUT}] */ +if (php_sapi_name() !== 'cli') { + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); +} + $timeout = 60; switch ($argc) { case 4: