17 lines
610 B
PHP
17 lines
610 B
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$gold = "/opt/wevads/vault/wevia.html.GOLD-20260421-230109-pre-safe-write";
|
|
$dest = "/var/www/html/wevia.html";
|
|
if (!file_exists($gold)) { echo json_encode(["error"=>"gold missing"]); exit; }
|
|
// Current backup first
|
|
$now_backup = "/opt/wevads/vault/wevia.html.GOLD-" . date("Ymd-His") . "-v8-broken";
|
|
@copy($dest, $now_backup);
|
|
// Restore
|
|
$bytes = @file_put_contents($dest, file_get_contents($gold));
|
|
echo json_encode([
|
|
"restored" => $bytes,
|
|
"gold" => basename($gold),
|
|
"backup_broken" => basename($now_backup),
|
|
"new_size" => filesize($dest),
|
|
]);
|