From 3b15d8dcd8912825281367ed959d7ad212e6a0ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 8 Apr 2017 21:56:30 +0200 Subject: Add user services --- service/syncthing | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 service/syncthing (limited to 'service/syncthing') diff --git a/service/syncthing b/service/syncthing new file mode 100755 index 0000000..8d0e009 --- /dev/null +++ b/service/syncthing @@ -0,0 +1,19 @@ +#!/home/cynerd/.local/sbin/user-service.sh +# vim: ft=sh + +description="Syncthing is an open, trustworthy and decentralized cloud storage system" +pidfile="/tmp/syncthing-$USER.pid" +logfile="/var/log/syncthing-$USER.log" + +status() { + [ -f $pidfile ] || return 1 + kill -0 "$(cat $pidfile)" || return 1 +} + +start() { + start-stop-daemon -S -bmp $pidfile -1 $logfile -2 $logfile -- syncthing -no-browser +} + +stop() { + start-stop-daemon -K -p $pidfile -x syncthing +} -- cgit v1.2.3