reset_default_app 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. #=================================================
  3. # IMPORT GENERIC HELPERS
  4. #=================================================
  5. # Load common variables for all scripts.
  6. source scripts/_common.sh
  7. source /usr/share/yunohost/helpers
  8. _set_frequencies
  9. #=================================================
  10. # DOWNLOAD, CHECK AND UNPACK SOURCE
  11. #=================================================
  12. ynh_script_progression --message="Resetting source files..." --time --weight=1
  13. # Download, check integrity, uncompress and patch the source from app.src
  14. (cd scripts; YNH_CWD=$PWD ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="passkey Backup_list.conf")
  15. # Set permissions on app files
  16. chown -R "root:root" "$install_dir"
  17. #=================================================
  18. # RECONFIGURE ARCHIVIST
  19. #=================================================
  20. ynh_script_progression --message="Reconfiguring archivist..." --time --weight=1
  21. yunohost app action run "$app" reset_default_config
  22. #=================================================
  23. # SYSTEM CONFIGURATION
  24. #=================================================
  25. ynh_script_progression --message="Resetting system configurations related to $app..." --weight=1
  26. # Use logrotate to manage application logfile(s)
  27. ynh_use_logrotate
  28. # Add Cron configuration file
  29. ynh_add_config --template="archivist.cron" --destination="/etc/cron.d/$app"
  30. #=================================================
  31. # END OF SCRIPT
  32. #=================================================
  33. ynh_script_progression --message="Execution completed" --time --last