#!/bin/bash
# script: filter.enlink
# Note: /bin/sh does not support pushd/popd, hence /bin/bash required
# Note: on BSD, it is necessary to link /usr/local/bin/bash to /bin/

if [ ! -d ~/Archive ]
then
  echo ~/Archive must exist
else
  pushd ~/Archive
  if [ -f _config/utility/rsync/filter.2arc ]
  then
    if [ -f filter ]
    then
      rm filter
    fi
    if [ ! -L filter ]
    then
      ln -s _config/utility/rsync/filter.2arc filter
    fi
  fi
  popd
fi
