1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monitorix_ynh.git synced 2024-09-03 19:46:06 +02:00
monitorix_ynh/scripts/restore
2017-07-21 22:11:45 +02:00

37 lines
No EOL
794 B
Bash
Executable file

#!/bin/bash
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Stop script if errors
ynh_abort_if_errors
# Import common cmd
source ../settings/scripts/_common.sh
# Retrieve old app settings
domain=$(ynh_app_setting_get "$app" domain)
path=$(ynh_normalize_url_path $(ynh_app_setting_get "$app" path))
# Check domain/path availability
ynh_webpath_available $domain $path || ynh_die "$domain/$path is not available, please use an other domain or path."
# Download package
get_source
# Download package
get_source
# Install package
install_dependances
# Create user for database
dbuser=$app
dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
ynh_mysql_create_user $dbuser $dbpass
# Restore all config and data
ynh_restore
# Reload services
systemctl restart monitorix.service