Added proc_open for execute commands in php

This commit is contained in:
absurdo 2023-11-27 13:56:58 +01:00
parent 72d741eb7d
commit 2efc7b72f3

View file

@ -228,7 +228,7 @@ class Linux {
if(!isset($original_file[$distro])) {
echo "Sorry, you don't have a patch for this distro\n";
echo "Sorry, you don't have a patch for this distro\n\n";
exit(1);
@ -244,7 +244,7 @@ class Linux {
if(!isset($service[$distro])) {
echo "Sorry, you don't have a service reload for this distro\n";
echo "Sorry, you don't have a service reload for this distro\n\n";
exit(1);
@ -270,9 +270,17 @@ class Linux {
}
static public function sed($str_search, $str_replace, $file_to_replace) {
static public function sed($arr_sed) {
if(!isset($arr_sed[$distro])) {
echo "Sorry, you don't have a sed str for this distro\n\n";
exit(1);
}
Linux::exec("sudo sed -i 's/${str_search}/${str_replace}/g' ${file_to_replace}");
Linux::exec("sudo sed -i 's/${arr_sed[$distro][0]}/${arr_sed[$distro][1]}/g' ${arr_sed[$distro][2]}");
}