1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/simple-torrent_ynh.git synced 2024-09-03 20:26:18 +02:00
simple-torrent_ynh/scripts/restore
Éric Gaspar dccb95d60b
Testing (#77)
* Update upgrade

* Update manifest.json

* Auto-update README

* Update restore

* Update remove

* Create DESCRIPTION.md

* Auto-update README

* Update DESCRIPTION.md

* Auto-update README

* Create updater.sh

* Update arm64.src

* Update manifest.json

* Auto-update README

* Update updater.sh

* Update updater.sh

* Update manifest.json

* Upgrade to version 1.3.7 (#62)

* Upgrade to v1.3.7

* Auto-update README

Co-authored-by: yunohost-bot <yunohost-bot@users.noreply.github.com>
Co-authored-by: Yunohost-Bot <>

* Update manifest.json

* Update check_process

* keep config (#67)

* Update upgrade

* Update manifest.json

* Auto-update README

* Auto-update README

* 4.3

* Update manifest.json

* Auto-update README

* Update manifest.json

* Auto-update README

* Update upgrade

* fix linter (#72)

* Update manifest.json

* Auto-update README

* Auto-update README

* Fix linter

* Update manifest.json

* Delete .DS_Store

* Delete .DS_Store

* Delete .DS_Store

* V2 (#76)

* Auto-update README

* v2

* v2

* Update change_url

* Delete .DS_Store

* v2

* Auto-update README

* Auto-update README

* fix

* Update restore

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>

* Auto-update README

* Auto-update README

* fix

* Update manifest.toml

* Auto-update README

---------

Co-authored-by: Yunohost-Bot <>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost-bot@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
2023-02-18 18:19:40 +01:00

62 lines
2.1 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring $app main directory..." --weight=4
ynh_restore_file --origin_path="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chmod +x $install_dir/$app
#=================================================
# RESTORE DATA
#=================================================
ynh_script_progression --message="Restoring $app data..." --weight=10
ynh_restore_file --origin_path="$data_dir" --not_mandatory
mkdir -p $data_dir/{torrents,downloads}
chmod 755 $data_dir/{torrents,downloads}
chmod -R o-rwx $data_dir
chown -R $app:www-data $data_dir
#=================================================
# RESTORE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
yunohost service add $app --description="Self-hosted remote torrent client" --needs_exposed_ports="$port_peer" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
ynh_systemd_action --service_name=$app --action=start --log_path=systemd
ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Restoration completed for $app" --last