X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fwait-for-connection;h=f0fd8cc60fd9fc71692490e9c682edc40b523272;hb=bf81f21001cead41585ecd549a98afe4e2797840;hp=eeb9ba980dbc21db688f9f534cff2726e990b0c5;hpb=1de3960e267a8d298348fbca18cf1be1f6a20f7a;p=friendica.git diff --git a/bin/wait-for-connection b/bin/wait-for-connection index eeb9ba980d..f0fd8cc60f 100755 --- a/bin/wait-for-connection +++ b/bin/wait-for-connection @@ -1,11 +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}] - . + * + * 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: