diff options
author | Benjamin Brahmer <info@b-brahmer.de> | 2020-10-25 10:30:26 +0100 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2020-10-25 12:06:30 +0100 |
commit | 9917bbe77466b90bed6e3aa18b0954986a6a13b1 (patch) | |
tree | 7dcc6aa5664e3906c70f6322a357b3968d736019 /bin | |
parent | d4570f387ed867dbc5429d8e24524b74f02c9490 (diff) |
Add file_from_env.php
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/tools/file_from_env.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/tools/file_from_env.php b/bin/tools/file_from_env.php new file mode 100755 index 000000000..e63cda1c4 --- /dev/null +++ b/bin/tools/file_from_env.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +<?php +/** + * Nextcloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Benjamin Brahmer <info@b-brahmer.de> + * @copyright Benjamin Brahmer 2020 +*/ + +if ($argc < 2) { + echo "This script expects two parameters:\n"; + echo "./file_from_env.php ENV_VAR PATH_TO_FILE\n"; + exit; +} + +# Read environment variable +$content = getenv($argv[1]); + +file_put_contents($argv[2], $content); + +echo "Done...\n";
\ No newline at end of file |