Merge pull request #36 from linuxserver/format

Format shell scripts
This commit is contained in:
Eric Nemchik 2023-01-18 06:01:31 -06:00 committed by GitHub
commit 64f46d4a4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -1,12 +1,12 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
# create folders
mkdir -p \
/config/cache
# clear previous config
for f in /app/www/public/config_local.*.php
do
for f in /app/www/public/config_local.*.php; do
if [ -f "$f" ]; then
rm "$f"
fi
@ -18,9 +18,8 @@ if [[ ! -e /config/config_local.php ]]; then
fi
# copy extra user-profiles
for f in /config/config_local*.php
do
cp "$f" /app/www/public/
for f in /config/config_local*.php; do
cp "$f" /app/www/public/
done
# permissions

View File

@ -1,10 +1,11 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
DEFAULT_CONF="/config/nginx/site-confs/default.conf"
OLD_ROOT="root\s*/var/www/localhost/cops;"
NEW_ROOT="root /app/www/public;"
if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}";then
if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}"; then
echo "updating root in ${DEFAULT_CONF}"
sed -i "s|${OLD_ROOT}|${NEW_ROOT}|" "${DEFAULT_CONF}"
fi