#!/bin/bash
set -e

cd /var/www/html/easychair

mysql -uroot -p'_MohdShquier@2025!' shquier_easychair < storage/backups/rbac/20260525_193634/rbac.sql

tar -xzf storage/backups/rbac/20260525_193634/layouts.tar.gz -C .

rm -rf storage/cache/*
rm -rf storage/views/*

systemctl restart php8.4-fpm
systemctl restart apache2

echo RESTORED
