Explorar o código

Update restore

Mickael-Martin %!s(int64=7) %!d(string=hai) anos
pai
achega
d189bf501c
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  1. 13 0
      scripts/restore

+ 13 - 0
scripts/restore

@@ -128,6 +128,17 @@ then
 	ynh_app_setting_delete $app skipped_uris
 fi
 
+#=================================================
+# Restore db
+#================================================= 
+
+db_name=$(ynh_app_setting_get $app db_name)
+db_user=$(ynh_app_setting_get $app db_user)
+db_pwd=$(ynh_app_setting_get $app mysqlpwd)
+
+ynh_mysql_setup_db $db_user $db_name $db_pwd
+ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql
+
 #=================================================
 # Restore configs files
 #=================================================
@@ -144,6 +155,8 @@ ynh_restore_file "/etc/zabbix"
 systemctl enable zabbix-server && systemctl start zabbix-server
 
 
+
+
 #=================================================
 # SETUP LOGROTATE
 #=================================================