From 2a541cecb9f0ba6f7d1d2db2b6362a3a023b2a44 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 1 Feb 2013 18:54:24 -0200 Subject: Making sync-home also sync-code --- sync-code | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 sync-code (limited to 'sync-code') diff --git a/sync-code b/sync-code new file mode 100755 index 0000000..bdb5f32 --- /dev/null +++ b/sync-code @@ -0,0 +1,24 @@ +#!/bin/bash +# +# sync code or home folder across systems +# + +BASENAME="`basename $0`" +DEST="$1" + +if [ ! -z "$DEST" ]; then + + if [ "$BASENAME" == "sync-code" ]; then + profile="$DEST-code" + else + profile="$DEST-home" + fi + + if [ -f "$HOME/.unison/$profile.prf" ]; then + unison $profile + else + echo "No such profile $HOME/.unison/$profile.prf" + exit 1 + fi + +fi -- cgit v1.2.3