A Syncthing launcher script for Mac OS X

Hi !

If anyone here want a little script to launch Syncthing as a deamon with logs in files, you can use this :

if [ -L $0 ] ; then
    DIR=$(dirname $(readlink -f $0)) ;
    DIR=$(dirname $0) ;
fi ;
timestamp=$(date +"%Y-%m-%d_%H-%M-%S");
$DIR/syncthing > $DIR/logs/$timestamp.log &
osascript -e 'tell application "Terminal" to close window 1' &

You can download the script here.

And thanks for Syncthing’s team for their work ! :slight_smile:

Maybe you can better wrap your script into Mac OS X launchd service and will load at startup: