From b26ec1d4d906e9225b9065c31a5c32edef02179e Mon Sep 17 00:00:00 2001 From: Edmund Tan Date: Tue, 22 Jul 2025 03:22:07 +0800 Subject: [PATCH] fix install script17 --- UI/includes/enrollment.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/UI/includes/enrollment.php b/UI/includes/enrollment.php index 34f12f4..60c15fa 100644 --- a/UI/includes/enrollment.php +++ b/UI/includes/enrollment.php @@ -427,11 +427,14 @@ EOF; private function createSystemdService() { $finalConfig = '/etc/zitirouter/zitirouter.yaml'; - // Copy router config to final location - if (!copy(ROUTER_CONFIG, $finalConfig)) { + // Copy router config to final location using sudo + if (!executeCommand("cp " . ROUTER_CONFIG . " '$finalConfig'")) { 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 = <<