fix install script17

This commit is contained in:
Edmund Tan 2025-07-22 03:22:07 +08:00
parent cddb7d97c1
commit b26ec1d4d9
1 changed files with 6 additions and 3 deletions

View File

@ -427,11 +427,14 @@ EOF;
private function createSystemdService() { private function createSystemdService() {
$finalConfig = '/etc/zitirouter/zitirouter.yaml'; $finalConfig = '/etc/zitirouter/zitirouter.yaml';
// Copy router config to final location // Copy router config to final location using sudo
if (!copy(ROUTER_CONFIG, $finalConfig)) { if (!executeCommand("cp " . ROUTER_CONFIG . " '$finalConfig'")) {
throw new Exception('Failed to copy router config to final location'); throw new Exception('Failed to copy router config to final location');
} }
chmod($finalConfig, 0644);
if (!executeCommand("chmod 644 '$finalConfig'")) {
throw new Exception('Failed to set final config permissions');
}
$serviceContent = <<<EOF $serviceContent = <<<EOF
[Unit] [Unit]