From 60dd794b296faf22db4d90e18de73e10cd3b3cf5 Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 9 Apr 2025 08:03:41 +0200 Subject: [PATCH] fix: Avoid pipe to head on find (#970) --- src/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/install.sh b/src/install.sh index 825b9ca..75bfa27 100644 --- a/src/install.sh +++ b/src/install.sh @@ -13,8 +13,8 @@ else fi FN="boot.pat" -DIR=$(find / -maxdepth 1 -type d -iname "$FN" | head -n 1) -[ ! -d "$DIR" ] && DIR=$(find "$STORAGE" -maxdepth 1 -type d -iname "$FN" | head -n 1) +DIR=$(find / -maxdepth 1 -type d -iname "$FN" -print -quit) +[ ! -d "$DIR" ] && DIR=$(find "$STORAGE" -maxdepth 1 -type d -iname "$FN" -print -quit) if [ -d "$DIR" ]; then BASE="DSM_VirtualDSM" && URL="file://$DIR" @@ -23,8 +23,8 @@ if [ -d "$DIR" ]; then fi fi -FILE=$(find / -maxdepth 1 -type f -iname "$FN" | head -n 1) -[ ! -s "$FILE" ] && FILE=$(find "$STORAGE" -maxdepth 1 -type f -iname "$FN" | head -n 1) +FILE=$(find / -maxdepth 1 -type f -iname "$FN" -print -quit) +[ ! -s "$FILE" ] && FILE=$(find "$STORAGE" -maxdepth 1 -type f -iname "$FN" -print -quit) [ -s "$FILE" ] && BASE="DSM_VirtualDSM" && URL="file://$FILE" if [ -n "$URL" ] && [ ! -s "$FILE" ] && [ ! -d "$DIR" ]; then