]> git.mxchange.org Git - friendica.git/blobdiff - bin/wait-for-connection
Merge pull request #8634 from annando/no-term
[friendica.git] / bin / wait-for-connection
index 67990f9f93bdb0f3e4cdd4842ee8afca8955bba8..b6c03a6705df9ef52f386e25fd2ff651f18fdd47 100755 (executable)
@@ -1,6 +1,29 @@
 #!/usr/bin/php
-
 <?php
+/**
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ * 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}]
+ */
+
 $timeout = 60;
 switch ($argc) {
        case 4:
@@ -37,4 +60,4 @@ do {
        fwrite(STDOUT, '.');
 } while (time() < $stopTime);
 fwrite(STDOUT, "\n");
-exit(1);
\ No newline at end of file
+exit(1);