Skip to content

Instantly share code, notes, and snippets.

@sneak
Created November 19, 2019 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sneak/03e67f373bd312b390b6ae8a8291a76a to your computer and use it in GitHub Desktop.
Save sneak/03e67f373bd312b390b6ae8a8291a76a to your computer and use it in GitHub Desktop.
/etc/service/syncthing/run
if [[ ! -d /secure/sneak/sync/Sync ]]; then
echo "sync dir not mounted, exiting" > /dev/stderr
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$(hostname) cannot access sync dir \"}" https://hooks.slack.com/services/lolno &
sleep 600
exit 1
fi
echo 204800 > /proc/sys/fs/inotify/max_user_watches
export STNODEFAULTFOLDER=1
export STNOUPGRADE=1
export HOME=/secure/sneak/sync
exec chpst -u syncthing:syncthing syncthing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment