#!/bin/sh
# 
# This script will update dotfiles from a remote web server.
# WARNING! Most of your common dotfiles (.bashrc, etc) will be overwritten!
# Put settings that you do not want overwritten in a file called
#     ~/.bashrc_local
# It will be sourced at the end of  the .bashrc script.
# 
# I am not a virus; although, I play one on the web.
#
# Noah Spurrier

# This is to get around old versions of wget.
wget --cache=off --version >/dev/null 2>&1
case $? in
    0)
        WGET="wget -q -nv -N --cache=off";; # older
    *)
        WGET="wget -q -nv -N --no-cache";; # newer
esac

rm -f dotfiles.tar.gz
$WGET http://www.noah.org/engineering/dotfiles/dotfiles.tar.gz
gunzip -c dotfiles.tar.gz | tar --no-same-owner -x
chmod 755 .dotfiles_install
./.dotfiles_install
rm -f dotfiles.tar.gz
