1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #!/bin/bash
- source ../settings/scripts/_common.sh
- source /usr/share/yunohost/helpers
- #=================================================
- # BACKUP THE APP MAIN DIR
- #=================================================
- ynh_print_info "Backing up the main app directory..."
- ynh_backup --src_path="/usr/local/bin/$service_name-loadcubefile.sh"
- ynh_backup --src_path="/etc/yunohost/hooks.d/90-vpnclient.tpl"
- ynh_backup --src_path="/etc/openvpn/client.conf.tpl"
- ynh_backup --src_path="/etc/openvpn/client.conf" --not_mandatory
- ynh_backup --src_path="/etc/openvpn/client.cube" --not_mandatory
- ynh_backup --src_path="/etc/openvpn/client.ovpn" --not_mandatory
- for FILE in $(ls /etc/openvpn/scripts/route-up.d/*-vpnclient-* /etc/openvpn/scripts/route-down.d/*-vpnclient-*); do
- ynh_backup --src_path="$FILE"
- done
- ynh_backup --src_path="/etc/openvpn/keys/"
- ynh_backup --src_path="/etc/openvpn/scripts/run-parts.sh"
- ynh_backup --src_path="/usr/local/bin/$service_name"
- ynh_backup --src_path="/usr/local/bin/$service_checker_name.sh"
- #=================================================
- # BACKUP SYSTEMD
- #=================================================
- ynh_print_info "Backing up systemd configuration..."
- ynh_backup --src_path="/etc/systemd/system/$service_name.service"
- ynh_backup --src_path="/etc/systemd/system/$service_checker_name.service"
- ynh_backup --src_path="/etc/systemd/system/$service_checker_name.timer"
- ynh_backup --src_path="/etc/systemd/system/openvpn@.service.d/override.conf"
- #=================================================
- # END OF SCRIPT
- #=================================================
- ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|