Skip to content

Commit

Permalink
extras: Update extras/mpvc-autostart
Browse files Browse the repository at this point in the history
  • Loading branch information
gmt4 committed Aug 18, 2024
1 parent 960c365 commit 338b353
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extras/mpvc-autostart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mpvc_defaults()
ARGS=${ARGS:-}
}

mpvc_pingcheck() { ping -w 5 -c 5 "$@" | awk 'NR == 2 && /time=/ { sub(":.*time=",": time="); print }'; }
mpvc_pingcheck() { ping -c 5 "$@" | awk 'NR == 2 && /time=/ { sub(":.*time=",": time="); print }'; }
mpvc_btcheck() { hcitool scan | awk "/$@/ {print}"; }

# monitor presence of your phone (eg LAN IP/BT): if device is present resume audio, otherwise, pause audio.
Expand All @@ -46,7 +46,7 @@ mpvc_autoscan()
[ "$ncheck" -gt 0 ] && mpvc -q resume # n>0 pings up: resume
[ "$ncheck" -le -$NCHECK ] && mpvc -q pause # n<0 pings down: pause
fi
echo "# $(date -Imin) PERIOD=$PERIOD NCHECK=$NCHECK pause=$pause c=${#check} n=${ncheck} $check" # $@
echo "# $(date) PERIOD=$PERIOD NCHECK=$NCHECK pause=$pause c=${#check} n=${ncheck} $check" # $@
done
}

Expand Down

0 comments on commit 338b353

Please sign in to comment.