From a05bb1317d617cf5075d5c3028d384424a36609b Mon Sep 17 00:00:00 2001 From: absurdo Date: Mon, 27 Nov 2023 01:14:05 +0100 Subject: [PATCH] Fixes in functions --- vendor/phangoapp/leviathanutils/src/Linux.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vendor/phangoapp/leviathanutils/src/Linux.php b/vendor/phangoapp/leviathanutils/src/Linux.php index 39e9478..bcedbc7 100644 --- a/vendor/phangoapp/leviathanutils/src/Linux.php +++ b/vendor/phangoapp/leviathanutils/src/Linux.php @@ -177,7 +177,7 @@ class Linux { } - static public function restart_service($service) { + static public function systemd_service($action, $service) { $distro=Linux::get_linux_distro(); @@ -189,7 +189,7 @@ class Linux { } - Linux::shell_command(["sudo ".$service[$distro]]); + Linux::shell_command(["sudo systemctl ${action}".$service[$distro]]); } @@ -209,6 +209,11 @@ class Linux { } + static public function sed($str_search, $str_replace, $file_to_replace) { + + Linux::exec("sudo sed -i 's/${str_search}/${str_replace}/g' ${file_to_replace}"); + + } static public function json_log($message, $error=0, $status=0, $progress=0, $no_progress=0) {