From 7d99809bb225814b60a9726b439a34770d6640d7 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 23 Mar 2017 14:32:25 +0100 Subject: [hardware-stats] Check for mktemp binary before trying to call it --- .../data/opt/openslx/scripts/systemd-hardware_stats | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'core/modules/hardware-stats/data/opt/openslx') 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 3aa7386e..e87c41e1 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 @@ -13,9 +13,11 @@ chmod 0600 "/tmp/hw-delete-list" || exit 11 echo -n "" > "/tmp/hw-delete-list" || exit 12 mktemp() { - local FILE - FILE=$(/bin/mktemp) - if [ -z "$FILE" ]; then + local FILE= + if [ -x /bin/mktemp ]; then + FILE=$(/bin/mktemp) + fi + if [ -z "$FILE" ] && [ -x /opt/openslx/bin/mktemp ]; then FILE=$(/opt/openslx/bin/mktemp) fi if [ -z "$FILE" ]; then -- cgit v1.2.3-55-g7522