Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-06-28 13:37:16 +0200
committerErich Eckner <git@eckner.net>2018-06-28 13:37:16 +0200
commit33f7b727030158a391d40760d2c3a04b0472859b (patch)
tree4d2a60102ab8133d421c5451141e6cd5420f4884
parentef4c263fd598a838537c61b8ed358f134e0fe1d5 (diff)
bin/ii-connect: abort on changing script
-rwxr-xr-xbin/ii-connect5
1 files changed, 4 insertions, 1 deletions
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