From 7a9ec120e13bf16710af8a1ed9f054537445d460 Mon Sep 17 00:00:00 2001 From: Miles Alan Date: Thu, 9 Jul 2020 18:22:30 -0500 Subject: [PATCH] Fork urlhandler program if run with fork option and pass opt in RSS script --- scripts/appscripts/sxmo_rss.sh | 2 +- scripts/core/sxmo_urlhandler.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/appscripts/sxmo_rss.sh b/scripts/appscripts/sxmo_rss.sh index 881c19c..80e8137 100755 --- a/scripts/appscripts/sxmo_rss.sh +++ b/scripts/appscripts/sxmo_rss.sh @@ -65,5 +65,5 @@ while true; do # Handle picked item URL="$(echo "$PICKED" | gawk -F " " '{print $NF}')" - sxmo_urlhandler.sh "$URL" + sxmo_urlhandler.sh "$URL" fork done diff --git a/scripts/core/sxmo_urlhandler.sh b/scripts/core/sxmo_urlhandler.sh index d6ded8e..780e837 100755 --- a/scripts/core/sxmo_urlhandler.sh +++ b/scripts/core/sxmo_urlhandler.sh @@ -1,4 +1,5 @@ #!/usr/bin/env sh +FORK="$2" if [ -n "$1" ] then @@ -40,4 +41,9 @@ COMMAND=$( [ -z "$COMMAND" ] && exit 1 RUN=$(echo "$URL" | xargs -IURL echo "$COMMAND") -st -e sh -c "$RUN" + +if [ "$FORK" = fork ]; then + st -e sh -c "$RUN" & +else + st -e sh -c "$RUN" +fi