From: Silvio Rhatto Date: Fri, 1 Feb 2013 20:54:24 +0000 (-0200) Subject: Making sync-home also sync-code X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=2a541cecb9f0ba6f7d1d2db2b6362a3a023b2a44;p=scripts.git Making sync-home also 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 diff --git a/sync-home b/sync-home deleted file mode 100755 index 4c9d6db..0000000 --- a/sync-home +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# -# sync home folder across systems -# - -DEST="$1" - -if [ ! -z "$DEST" ]; then - profile="$DEST-home" - if [ -f "$HOME/.unison/$profile.prf" ]; then - unison $profile - else - echo "No such profile $HOME/.unison/$profile.prf" - exit 1 - fi -fi diff --git a/sync-home b/sync-home new file mode 120000 index 0000000..e737e41 --- /dev/null +++ b/sync-home @@ -0,0 +1 @@ +sync-code \ No newline at end of file