aboutsummaryrefslogtreecommitdiff
path: root/unisync-all
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-10-13 15:04:23 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-10-13 15:04:23 -0300
commitf1e7ddcf948b81b2eae5bc7c72b47f8caf13360a (patch)
tree55ffd6cfc3218ad40eb9f2332fd93f5820b304d4 /unisync-all
parent710603069e348c9f2029c337891e06f7439ab85d (diff)
downloadunisyncer-f1e7ddcf948b81b2eae5bc7c72b47f8caf13360a.tar.gz
unisyncer-f1e7ddcf948b81b2eae5bc7c72b47f8caf13360a.tar.bz2
Rename scripts to unisync-
Diffstat (limited to 'unisync-all')
-rwxr-xr-xunisync-all51
1 files changed, 51 insertions, 0 deletions
diff --git a/unisync-all b/unisync-all
new file mode 100755
index 0000000..c11837d
--- /dev/null
+++ b/unisync-all
@@ -0,0 +1,51 @@
+#!/bin/bash
+#
+# sync code or home folder across systems
+#
+
+BASENAME="`basename $0`"
+DEST="$1"
+UNISON="unison"
+
+# Use the following config if you need to sync with legacy systems
+UNISON="unison"
+
+function sync_code_run {
+ local config="$1"
+
+ if [ -z "$config" ]; then
+ return
+ fi
+
+ if [ -f "$HOME/.unison/$config.prf" ]; then
+ echo "Starting sync using $config..."
+ $UNISON $config
+ else
+ echo "Skipping absent profile $config."
+ return
+ fi
+}
+
+if [ ! -z "$DEST" ]; then
+ profiles=""
+
+ if [ "$BASENAME" == "unisync-code" ] || [ "$BASENAME" == "unisync-all" ]; then
+ profiles="$profiles $DEST-code"
+ fi
+
+ if [ "$BASENAME" == "unisync-irssi" ] || [ "$BASENAME" == "unisync-all" ]; then
+ profiles="$profiles $DEST-irssi"
+ fi
+
+ if [ "$BASENAME" == "unisync-irssi-tor" ] || [ "$BASENAME" == "unisync-all" ]; then
+ profiles="$profiles $DEST-irssi-tor"
+ fi
+
+ if [ "$BASENAME" == "unisync-home" ] || [ "$BASENAME" == "unisync-all" ]; then
+ profiles="$profiles $DEST-home"
+ fi
+
+ for profile in $profiles; do
+ sync_code_run $profile
+ done
+fi