From c0acb244918cd1c04466bf093693762b4da29742 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Sun, 15 Aug 2021 13:15:10 +0200 Subject: [PATCH] Add a simple script to watch for mapfile changes --- ddwatch.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 ddwatch.sh diff --git a/ddwatch.sh b/ddwatch.sh new file mode 100755 index 0000000..9e438e6 --- /dev/null +++ b/ddwatch.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -eu +file="$1" +str='Current' +interval=5 +ding="/usr/share/bzflag/pop.wav" + +last="$(grep "$str" "$file")" +while sleep $interval +do + cur="$(grep "$str" "$file")" + test "$cur" != "$last" && mpv "$ding" + last="$cur" +done