From 608748475f44207c1692bcc01776eacf131872b2 Mon Sep 17 00:00:00 2001 From: alex-eg Date: Fri, 4 Jan 2019 13:13:10 +0300 Subject: [PATCH] complete syncthing-keepalive script --- syncthing-keepalive/check-syncthing.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/syncthing-keepalive/check-syncthing.sh b/syncthing-keepalive/check-syncthing.sh index 8c43980..698aeff 100644 --- a/syncthing-keepalive/check-syncthing.sh +++ b/syncthing-keepalive/check-syncthing.sh @@ -22,5 +22,6 @@ if ! is_syncthing_running; then fi screen -DmS "${screen_name}" syncthing & screen_pid=$! - # todo! find pid of syncthing and store it to pid file + shell_pid=$(ps h --ppid "${screen_pid}" -opid) + ps h --ppid "${shell_pid}" -opid > "${pid_file}" fi