#!/bin/sh # VA1DER - apprentice.va1der.net startup script for Syncthing # Make sure you open up the port for syncthing in the firewall settings # Recommend OpenWrt's full-featured nuhup package for this: 'opkg install coreutils-nohup' # Base dir for where the Syncthing config folder and logs will go - be mindful # of wear on your device's internal flash and perhaps locate this on a USB or # sdcard drive as your device supports ETCDIR=/root/admin/etc # Use the daemonize tool to run Syncthing if you have access to it #/usr/local/sbin/daemonize -p /var/run/syncthing.pid -u root -l /var/lock/syncthing.lock /usr/bin/syncthing serve --logfile=$ETCDIR/syncthing/syncthing.log --log-max-size=10485760 --log-max-old-files=3 --data=$ETCDIR/syncthing --config=$ETCDIR/syncthing --no-upgrade # Otherwise nohup is a good alternative... nohup /usr/bin/syncthing serve --logfile=$ETCDIR/syncthing/syncthing.log --log-max-size=10485760 --log-max-old-files=3 --data=$ETCDIR/syncthing --config=$ETCDIR/syncthing --no-upgrade 0<&- &>/dev/null & # end.