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 ++++++++++++++++++++++++ sync-home | 17 +---------------- 2 files changed, 25 insertions(+), 16 deletions(-) create mode 100755 sync-code mode change 100755 => 120000 sync-home 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 -- cgit v1.2.3