Merge pull request #47 from linuxserver/format

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

View File

@ -1,16 +1,17 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
# make our folders
mkdir -p \
/config/{crontabs,www/freshrss}
# create symlinks
symlinks=( \
/app/www/data \
/app/www/extensions )
symlinks=(
/app/www/data
/app/www/extensions
)
for i in "${symlinks[@]}"
do
for i in "${symlinks[@]}"; do
if [[ -e "$i" && ! -L "$i" ]]; then
mv "$i" "${i}.bak"
fi
@ -23,7 +24,7 @@ do
done
# backwards compatibility
if grep -q 'root /config/www/freshrss/p;' /config/nginx/site-confs/default.conf; then
if grep -q 'root /config/www/freshrss/p;' /config/nginx/site-confs/default.conf; then
cp /defaults/nginx/site-confs/default.conf.sample /config/nginx/site-confs/default.conf
fi

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 /usr/share/webapps/freshrss/p;"
NEW_ROOT="root /app/www/p;"
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