aboutsummaryrefslogtreecommitdiff
path: root/sync-code
blob: 1211ebdd1a99b0db95119b493a6ed05ca7a03699 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
#
# sync code or home folder across systems
#

BASENAME="`basename $0`"
DEST="$1"
UNISON="unison-2.32.52"

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