Created
August 7, 2012 08:44
-
-
Save macek/3283383 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BREW_POSTGRES_DIR=`brew info postgres | awk '{print $1"/bin"}' | grep "/postgresql/"` | |
LION_POSTGRES_DIR=`which postgres | xargs dirname` | |
LION_PSQL_DIR=`which psql | xargs dirname` | |
sudo mkdir -p $LION_POSTGRES_DIR/archive | |
sudo mkdir -p $LION_PSQL_DIR/archive | |
for i in `ls $BREW_POSTGRES_DIR` | |
do | |
if [ -f $LION_POSTGRES_DIR/$i ] | |
then | |
sudo mv $LION_POSTGRES_DIR/$i $LION_POSTGRES_DIR/archive/$i | |
sudo ln -s $BREW_POSTGRES_DIR/$i $LION_POSTGRES_DIR/$i | |
fi | |
if [ -f $LION_PSQL_DIR/$i ] | |
then | |
sudo mv $LION_PSQL_DIR/$i $LION_PSQL_DIR/archive/$i | |
sudo ln -s $BREW_POSTGRES_DIR/$i $LION_PSQL_DIR/$i | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment