#!/usr/bin/env bash # Run resilio (bittorrent sync) from $HOME if it isn't running. Otherwise, open # its gui in the browser. if command -v xdg-open >/dev/null; then open=xdg-open elif command -v open >/dev/null; then open=open elif [[ $BROWSER ]]; then open=firefox else >&2 echo "No program to open urls with" fi if ! pgrep rslsync >/dev/null; then pushd $HOME >/dev/null rslsync & popd >/dev/null fi [[ -t 0 ]] && $open http://localhost:8888/gui/