summaryrefslogtreecommitdiffstats
path: root/core/modules/hardware-stats
diff options
context:
space:
mode:
authorSimon Rettberg2020-08-27 17:02:32 +0200
committerSimon Rettberg2020-08-27 17:02:32 +0200
commit0924b745af44a412a84d9cd9930ac04a910843c9 (patch)
treef42ce8da6b728af4fe23e80468651f242f908fa3 /core/modules/hardware-stats
parent[etherwake] Fix filename in REQUIRED_FILES (diff)
downloadmltk-0924b745af44a412a84d9cd9930ac04a910843c9.tar.gz
mltk-0924b745af44a412a84d9cd9930ac04a910843c9.tar.xz
mltk-0924b745af44a412a84d9cd9930ac04a910843c9.zip
[hardware-stats] Move sed so we can properly get the exit code
Diffstat (limited to 'core/modules/hardware-stats')
-rwxr-xr-xcore/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
index 9de35095..65677bb0 100755
--- a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
+++ b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
@@ -54,7 +54,7 @@ cleanup() {
slxfdisk() {
local binary RET
for binary in "/opt/openslx/sbin/fdisk -u" "busybox fdisk -u" "fdisk"; do
- $binary "$@" | sed -r 's/\s+[0-9]+,[0-9]+,[0-9]+\s+/ /g' # Work around busybox YET AGAIN changing something in an incompatible way
+ $binary "$@"
RET=$?
[ "$RET" = "127" ] && continue # command not found
[ "$RET" = "1" ] && [ "${binary%% *}" = "busybox" ] && continue # maybe applet not found
@@ -174,7 +174,7 @@ if ! slx-tools fs_path_isvolatile "/tmp/virt" ; then
fi
if [ "$ID44" = 0 ]; then
# slxfdisk fallback
- for c in $(slxfdisk -l | grep -E '[0-9]+[\-\+]?\s+44\s+' | awk '{print $1}'); do
+ for c in $(slxfdisk -l | grep -E '[0-9]+[\-\+MG]?\s+44\s+' | awk '{print $1}'); do
val=$(blockdev --getsize64 "$c")
[ -z "$val" ] && continue
[ "$val" -gt "$ID44" ] && ID44=$val
@@ -196,7 +196,7 @@ for disk in /dev/disk/by-path/!(*-part*|*-usb-*); do
[ -L "$disk" ] || continue
disk="$( readlink -f "$disk" )"
DISKS+=("$disk")
- slxfdisk -l "$disk"
+ slxfdisk -l "$disk" | sed -r 's/\s+[0-9]+,[0-9]+,[0-9]+\s/ /g' # Work around busybox YET AGAIN changing something in an incompatible way
done > "$FDISK"
shopt -u extglob
[ -z "$SLX_SMARTCTL_MIN_REALLOC" ] && SLX_SMARTCTL_MIN_REALLOC=0