X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fwait-for-connection;h=388a660b8830782ffba8983859e8404922882a53;hb=51a7b5c5846c320dd273f5b1005d856416dd1252;hp=81f5e169e41db5b7ce4746a9cf76488875d0c346;hpb=c65d574ac3323e3d4b42788b58e00598176173de;p=friendica.git diff --git a/bin/wait-for-connection b/bin/wait-for-connection index 81f5e169e4..388a660b88 100755 --- a/bin/wait-for-connection +++ b/bin/wait-for-connection @@ -1,6 +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: