Fixes in returns

This commit is contained in:
Antonio de la Rosa 2025-11-09 12:04:25 +01:00
parent 6fd6c10e81
commit 8e93bfdcc6

View file

@ -148,7 +148,7 @@ class Linux {
$str_user.=" ${username}";
Linux::shell_command([$str_user]);
return Linux::shell_command([$str_user]);
}
@ -172,19 +172,19 @@ class Linux {
if($distro=='debian' || $distro=='ubuntu') {
Linux::shell_command(['sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y '.$package[$distro]]);
return Linux::shell_command(['sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y '.$package[$distro]]);
}
else if($distro=='fedora' || $distro=='almalinux' || $distro=='rocky') {
//if call("sudo dnf install -y {}".format(package[linux_distro]), shell=True) > 0:
Linux::shell_command(['sudo dnf install -y '.$package[$distro]]);
return Linux::shell_command(['sudo dnf install -y '.$package[$distro]]);
}
else if($distro=='arch') {
//sudo pacman -S --noconfirm
Linux::shell_command(['sudo pacman -S --noconfirm '.$package[$distro]]);
return Linux::shell_command(['sudo pacman -S --noconfirm '.$package[$distro]]);
}
@ -220,7 +220,7 @@ class Linux {
}
Linux::shell_command(["sudo systemctl ${action} ".$service[$distro]]);
return Linux::shell_command(["sudo systemctl ${action} ".$service[$distro]]);
}
@ -236,7 +236,7 @@ class Linux {
}
Linux::shell_command($executable[$distro]);
return Linux::shell_command($executable[$distro]);
}
@ -252,7 +252,7 @@ class Linux {
}
Linux::shell_command(["sudo sed -i", "\"s/".$arr_sed[$distro][0]."/".$arr_sed[$distro][1]."/g\" ".$arr_sed[$distro][2]]);
return Linux::shell_command(["sudo sed -i", "\"s/".$arr_sed[$distro][0]."/".$arr_sed[$distro][1]."/g\" ".$arr_sed[$distro][2]]);
}
@ -265,5 +265,10 @@ class Linux {
}
static public function check_domain_name($domain_name) {
return preg_match("/^(a-z\d*)(\.(a-z\d*))*$/i", $domain_name);
}
}