From aa0aa7c6add9eecd27e72cf7dd92af3f85fe87be Mon Sep 17 00:00:00 2001 From: f3fora <33097027+f3fora@users.noreply.github.com> Date: Wed, 30 Jun 2021 22:42:51 +0200 Subject: [PATCH] Kill the process on remarkable at the end close #66 --- reStream.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reStream.sh b/reStream.sh index 08c41b7..6285cd6 100755 --- a/reStream.sh +++ b/reStream.sh @@ -93,6 +93,13 @@ ssh_cmd() { ssh -o ConnectTimeout=1 -o PasswordAuthentication=no "root@$remarkable" "$@" } +# kill reStream on remarkable at the end. +# shellcheck disable=SC2016 +exit_rm() { + ssh_cmd 'kill $(pidof restream)' +} +trap exit_rm EXIT INT HUP + # SSH_CONNECTION is a variable on reMarkable => ssh '' instead of ssh "" # shellcheck disable=SC2016 remarkable_ip() {