script.sh 653 B

123456789101112131415
  1. {% macro script(values) -%}
  2. #!/bin/sh
  3. {%- set mappings = {
  4. "%s/filebrowser.json"|format(values.consts.config_path): "%s/settings.json"|format(values.consts.config_path),
  5. "%s/database.db"|format(values.consts.config_path): "%s/filebrowser.db"|format(values.consts.config_path),
  6. } %}
  7. echo "Migrating FileBrowser configuration files..."
  8. {%- for src, dest in mappings.items() %}
  9. echo "Checking for file at [{{ src }}]..."
  10. [ -f {{ src }} ] && { echo "File found at [{{ src }}], renaming to {{ dest }}"; mv "{{ src }}" "{{ dest }}"; } || echo "File not found at [{{ src }}], no need to migrate."
  11. {%- endfor %}
  12. echo "Migration complete."
  13. {%- endmacro %}