aboutsummaryrefslogtreecommitdiff
path: root/sync-code
blob: 24b39f2877d13383b0022441dc4e647d246bb0dc (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
26
27
#!/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"
  elif [ "$BASENAME" == "sync-irssi" ]; 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