From 11cb290ae899d7f5e38e2040d748e84bf21c00ad Mon Sep 17 00:00:00 2001 From: f Date: Sat, 10 Sep 2022 18:16:39 -0300 Subject: [PATCH] use syslog, start/stop correctly --- syncthingd.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/syncthingd.sh b/syncthingd.sh index 7b1e7ed..6ea9487 100755 --- a/syncthingd.sh +++ b/syncthingd.sh @@ -2,16 +2,13 @@ pid=/tmp/syncthing.pid dir=/home/syncthing -log=/home/syncthing/syncthing.log case $1 in start) - rm -f ${pid} - install -dm 2750 -o syncthing -g syncthing ${dir}/Sync/.stfolder daemonize -p ${pid} -l ${pid} -u syncthing -c ${dir} \ - -a -e ${log} -o ${log} \ + /usr/bin/syslogize \ /usr/bin/syncthing serve \ --gui-address=http://[::]:8384 \ --no-browser \ @@ -20,6 +17,7 @@ case $1 in --unpaused ;; stop) - cat ${pid} | xargs -r kill + test ! -f $pid || cat ${pid} | xargs -r kill + rm -f ${pid} ;; esac