#!/bin/bash target=$1 if [ -z "$target" ]; then echo "ffsync TARGET (example.com, user@example.com, etc)" exit 1 fi if pgrep -af firefox-bin > /dev/null; then echo "Firefox is running, aborting" exit 2 fi if ssh $target "pgrep -af firefox-bin"; then echo "Firefox is running on $target, aborting" exit 3 fi echo "Firefox doesn't seem to be running. Syncing." rsync --delete -avz ~/.mozilla/firefox ${target}:.mozilla/