backup 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. #=================================================
  3. # GENERIC START
  4. #=================================================
  5. # IMPORT GENERIC HELPERS
  6. #=================================================
  7. # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
  8. source ../settings/scripts/_common.sh
  9. source /usr/share/yunohost/helpers
  10. #=================================================
  11. # DECLARE DATA AND CONF FILES TO BACKUP
  12. #=================================================
  13. ynh_print_info --message="Declaring files to be backed up..."
  14. #=================================================
  15. # BACKUP THE APP MAIN DIR
  16. #=================================================
  17. ynh_backup --src_path="/etc/hostapd/$app/hostapd.conf" --not_mandatory
  18. ynh_backup --src_path="/etc/dnsmasq.$app/dhcpdv6.conf" --not_mandatory
  19. ynh_backup --src_path="/etc/dnsmasq.$app/dhcpdv4.conf" --not_mandatory
  20. ynh_backup --src_path="/usr/local/bin/$service_name"
  21. ynh_backup --src_path="/etc/openvpn/scripts/route-up.d/90-$service_name"
  22. ynh_backup --src_path="/etc/openvpn/scripts/route-down.d/90-$service_name"
  23. ynh_backup --src_path="/etc/systemd/system/$service_name.service"
  24. ynh_backup --src_path="/etc/systemd/system/hostapd@$app.service"
  25. #=================================================
  26. # END OF SCRIPT
  27. #=================================================
  28. ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."