[docker-entrypoint.sh] Add custom formats (#3179)

This commit is contained in:
Jan Justi 2022-12-10 17:25:25 -03:00 committed by GitHub
parent b4f9d27424
commit 933be15a77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -1,21 +1,24 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# - Find custom files (bridges, whitelist, config.ini) in the /config folder # - Find custom files (bridges, formats, whitelist, config.ini) in the /config folder
# - Copy them to the respective folders in /app # - Copy them to the respective folders in /app
# This will overwrite previous configs and bridges of same name # This will overwrite previous configs, bridges and formats of same name
# If there are no matching files, rss-bridge works like default. # If there are no matching files, rss-bridge works like default.
find /config/ -type f -name '*' -print0 2> /dev/null | find /config/ -type f -name '*' -print0 2> /dev/null |
while IFS= read -r -d '' file; do while IFS= read -r -d '' file; do
file_name="$(basename "$file")" # Strip leading path file_name="$(basename "$file")" # Strip leading path
if [[ $file_name = *" "* ]]; then if [[ $file_name = *" "* ]]; then
printf 'Custom Bridge %s has a space in the name and will be skipped.\n' "$file_name" printf 'Custom file %s has a space in the name and will be skipped.\n' "$file_name"
continue continue
fi fi
case "$file_name" in case "$file_name" in
*Bridge.php) yes | cp "$file" /app/bridges/ ; *Bridge.php) yes | cp "$file" /app/bridges/ ;
chown www-data:www-data "/app/bridges/$file_name"; chown www-data:www-data "/app/bridges/$file_name";
printf "Custom Bridge %s added.\n" $file_name;; printf "Custom Bridge %s added.\n" $file_name;;
*Format.php) yes | cp "$file" /app/formats/ ;
chown www-data:www-data "/app/formats/$file_name";
printf "Custom Format %s added.\n" $file_name;;
config.ini.php) yes | cp "$file" /app/ ; config.ini.php) yes | cp "$file" /app/ ;
chown www-data:www-data "/app/$file_name"; chown www-data:www-data "/app/$file_name";
printf "Custom config.ini.php added.\n";; printf "Custom config.ini.php added.\n";;