Minor grep improvements

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-07-02 22:53:23 +01:00
parent 7289e685ab
commit 33cd3bece9
2 changed files with 2 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ mkfifo "$PIPE"
ntfy serve > "$PIPE" 2>&1 & ntfy serve > "$PIPE" 2>&1 &
PID=$! PID=$!
grep -q "INFO Listening on :80\[http\]" < "$PIPE" grep -q -m 1 "INFO Listening on :80\[http\]" < "$PIPE"
kill "$PID" kill "$PID"
wait "$PID" || true wait "$PID" || true
rm -f "$PIPE" rm -f "$PIPE"

View File

@@ -70,7 +70,7 @@ mkfifo "$CAT_PIPE" "$GREP_PIPE"
tee "$CAT_PIPE" "$GREP_PIPE" < "$PIPE" > /dev/null & tee "$CAT_PIPE" "$GREP_PIPE" < "$PIPE" > /dev/null &
cat "$CAT_PIPE" & cat "$CAT_PIPE" &
grep -qm1 "Serving RPC and Web requests on 0.0.0.0:9091" < "$GREP_PIPE" grep -q -m 1 "Serving RPC and Web requests on 0.0.0.0:9091" < "$GREP_PIPE"
rpc_path="$(jq -r '.["rpc-url"]' /etc/transmission/settings.json)" rpc_path="$(jq -r '.["rpc-url"]' /etc/transmission/settings.json)"
rpc_url="http://127.0.0.1:9091${rpc_path}rpc/" rpc_url="http://127.0.0.1:9091${rpc_path}rpc/"