mirror of
https://github.com/Zygo/bees.git
synced 2025-06-15 09:16:34 +02:00
beesd: Fix the wrapper not finding any config file
`grep -q something | grep -q something_else` will never find anything.
The for-loop is redundant anyways because `grep -l` can already work for
us. Let's replace this with a shorter and working version.
CC: Timofey Titovets <timofey.titovets@synesis.ru>
(fixes: commit 06d41fd
"Rewrite beesd arg parser")
Signed-off-by: Kai Krakow <kai@kaishome.de>
This commit is contained in:
@ -72,15 +72,9 @@ done
|
||||
[ -z "$UUID" ] && help
|
||||
|
||||
|
||||
FILE_CONFIG=""
|
||||
for file in "$CONFIG_DIR"/*.conf; do
|
||||
[ ! -f "$file" ] && continue
|
||||
if grep -q 'UUID=' "$file" | grep -q -- "$UUID"; then
|
||||
INFO "Find $UUID in $file, use as conf"
|
||||
FILE_CONFIG="$file"
|
||||
fi
|
||||
done
|
||||
FILE_CONFIG="$(egrep -l '^[^#]*UUID\s*=\s*"?'"$UUID" "$CONFIG_DIR"/*.conf | head -1)"
|
||||
[ ! -f "$FILE_CONFIG" ] && ERRO "No config for $UUID"
|
||||
INFO "Find $UUID in $FILE_CONFIG, use as conf"
|
||||
source "$FILE_CONFIG"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user