From 788680a780537dd7ecd77e321ea6c70b60ce0704 Mon Sep 17 00:00:00 2001 From: Stephan de Wit Date: Wed, 22 Jan 2025 10:06:03 +0100 Subject: [PATCH] system: mute disk space status in case of live install media --- .../OPNsense/System/Status/DiskSpaceStatus.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/opnsense/mvc/app/library/OPNsense/System/Status/DiskSpaceStatus.php b/src/opnsense/mvc/app/library/OPNsense/System/Status/DiskSpaceStatus.php index 63263a84a..aac3b0e4a 100644 --- a/src/opnsense/mvc/app/library/OPNsense/System/Status/DiskSpaceStatus.php +++ b/src/opnsense/mvc/app/library/OPNsense/System/Status/DiskSpaceStatus.php @@ -43,6 +43,23 @@ class DiskSpaceStatus extends AbstractStatus public function collectStatus() { + /** + * If live media, disk space status should be muted, + * use the same (inverted) logic as LiveMediaStatus + */ + + $file = '/.probe.for.readonly'; + + if (!file_exists($file)) { + return; + } + + $fd = @fopen($file, 'w'); + if (!$fd) { + return; + } + fclose($fd); + $backend = new Backend(); $output = json_decode($backend->configdRun('system diag disk'), true);