This is a simple script to control syncthing
. It is
possible to also source this script in 'sh'-like shells (tested in dash
,
bash
and zsh
).
When used as a script it accepts a number of subcommands; if sourced, a number
of syncthing_*
functions are defined.
Starts the Syncthing process silently into a background tmux
session.
Open a browser window with the Syncthing web GUI; if a session has not been started beforehand, it is started before the web GUI is launched.
Stops the Syncthing process and the tmux
session.
Opens the tmux
session for inspecting the log, if necessary.
Exits with exit code 0 if a tmux
session with Syncthing has been started;
exit code 1 otherwise. (The output is always empty)
Original credits go to https://sts10.github.io/2018/11/27/syncthing-and-tmux.html.
Initial improvements made collaboratively at https://gist.github.com/shello/dea96c183f9e8e7fe181ef12335b44cf
ISC License
Copyright (c) 2019, Filipe 'shello' Rodrigues
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.