mirror of
https://github.com/YunoHost-Apps/z-push_ynh.git
synced 2024-09-03 18:05:58 +02:00
Initial commit
This commit is contained in:
parent
2a1b5832de
commit
547489e618
1 changed files with 42 additions and 0 deletions
42
scripts/restore
Executable file
42
scripts/restore
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/bin/bash
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
# Source YunoHost helpers
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
# Retrieve old app settings
|
||||
path=$(ynh_app_setting_get $app path)
|
||||
domain=$(ynh_app_setting_get $app domain)
|
||||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
final_logpath=$(ynh_app_setting_get $app final_logpath)
|
||||
final_nginxconf=$(ynh_app_setting_get $app finalnginxconf)
|
||||
final_phpconf=$(ynh_app_setting_get $app finalphpconf)
|
||||
|
||||
# Restore sources, data and permissions
|
||||
sudo mkdir -p $final_path
|
||||
sudo cp -a ./sources/* $final_path/
|
||||
sudo chown -R www-data: $final_path
|
||||
|
||||
# Restore logs, data & permissions
|
||||
sudo mkdir -p $final_logpath
|
||||
sudo cp -a ./logs/* $logs/
|
||||
sudo chown -R www-data:www-data $final_logpath
|
||||
|
||||
# Restore NGINX configuration
|
||||
sudo cp -a ./nginx.conf $final_nginxconf
|
||||
|
||||
# Restore PHP-FPM configuration
|
||||
sudo cp -a ./php-fpm.conf $final_phpconf
|
||||
sudo chown root: $final_phpconf
|
||||
sudo chmod 644 $final_phpconf
|
||||
|
||||
# Make app public
|
||||
ynh_app_setting_set $app skipped_uris "/"
|
||||
|
||||
|
||||
# Restart webserver
|
||||
sudo service nginx reload
|
||||
sudo service php5-fpm reload
|
||||
sudo yunohost app ssowatconf
|
||||
|
Loading…
Add table
Reference in a new issue