Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jorikfon committed Oct 8, 2024
2 parents aa547da + e5051ec commit 9b4f59a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Core/System/Configs/VmToolsConf.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ private function getCpuVendor(): string
$grepPath = Util::which('grep');
$awk = Util::which('awk');
$result = shell_exec("$lsCpuPath | $grepPath vendor | $awk -F ' ' '{ print $3}'");
return strtolower(trim($result));
return strtolower(trim($result??''));
}
}
4 changes: 2 additions & 2 deletions src/Core/System/RootFS/sbin/pbx_firmware
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ else
rm -rf "${img_file}";
fi

echo " - Reboot pending. Cancel with rm /tmp/rebooting ..."
echo " - Reboot pending. Cancel with 'touch /tmp/cancel_rebooting'"
# Waiting timeout
WAIT_TIME=10
counter=0
while [ $counter -lt $WAIT_TIME ]; do
if [ ! -f /tmp/rebooting ]; then
if [ -f /tmp/cancel_rebooting ]; then
# Flag file was deleted
echo "System reboot was cancelled"
exit 0
Expand Down
4 changes: 2 additions & 2 deletions src/Core/System/RootFS/sbin/pbx_init
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ while : ; do
fi

if [ -f /tmp/rebooting ]; then
echo "Reboot pending (${0}). Cancel with rm /tmp/rebooting"
echo "Reboot pending (${0}). Cancel with 'touch /tmp/cancel_rebooting'"
# Waiting timeout
WAIT_TIME=10
counter=0

while [ $counter -lt $WAIT_TIME ]; do
if [ ! -f /tmp/rebooting ]; then
if [ -f /tmp/cancel_rebooting ]; then
# Flag file was deleted
echo "System reboot was cancelled"
touch /tmp/start_sh
Expand Down
6 changes: 3 additions & 3 deletions src/Core/System/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ public static function getDevPartName(string $dev, string $part, bool $verbose =
$sortPath = Util::which('sort');

$basenameDisk = basename($dev);
$pathToDisk = trim(shell_exec("$lsBlkPath -n -p -a -r -o NAME,TYPE | $grepPath disk | $grepPath '$basenameDisk' | $cutPath -d ' ' -f 1"));
$pathToDisk = trim(shell_exec("$lsBlkPath -n -p -a -r -o NAME,TYPE | $grepPath disk | $grepPath '$basenameDisk' | $cutPath -d ' ' -f 1")??'');
if ($verbose) {
echo "Get dev full path..." . PHP_EOL;
echo "Source dev: $dev, result full path: $pathToDisk" . PHP_EOL;
Expand All @@ -528,9 +528,9 @@ public static function getDevPartName(string $dev, string $part, bool $verbose =

// Touch the disk to update disk tables
$command = "$lsBlkPath -r -p | $grepPath ' part' | $sortPath -u | $cutPath -d ' ' -f 1 | $grepPath '" . $pathToDisk . "' | $grepPath \"$part\$\"";
$devName = trim(shell_exec($command));
$devName = trim(shell_exec($command??'')??'');
if (empty($devName) && $verbose) {
$verboseMsg = trim(shell_exec("$lsBlkPath -r -p"));
$verboseMsg = trim(shell_exec("$lsBlkPath -r -p")??'');
echo "--- filtered command ---" . PHP_EOL;
echo $command . PHP_EOL;
echo "--- result 'lsblk -r -p' ---" . PHP_EOL;
Expand Down

0 comments on commit 9b4f59a

Please sign in to comment.