From 33f7b727030158a391d40760d2c3a04b0472859b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 28 Jun 2018 13:37:16 +0200 Subject: bin/ii-connect: abort on changing script --- bin/ii-connect | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/ii-connect b/bin/ii-connect index 296dc94..bbc9492 100755 --- a/bin/ii-connect +++ b/bin/ii-connect @@ -37,9 +37,12 @@ if ! pgrep -f '/ii-connect watch$' > /dev/null; then screen -S ii-connect.watch -d -m "${base_dir}/bin/ii-connect" watch fi +checksum=$(calculate_script_checksum) + # watch if asked to if [ "$1" = 'watch' ]; then - while pgrep -x 'ii' > /dev/null; do + while pgrep -x 'ii' >/dev/null && \ + [ "$(calculate_script_checksum)" = "${checksum}" ]; do # this avoids missing modifications during our last execution if [ -z "${said}" ]; then # shellcheck disable=SC2046 -- cgit v1.2.3-70-g09d2