sync/sync.sh

48 lines
1.6 KiB
Bash
Raw Normal View History

while getopts ":bsdtc" VALUE "$@"; do
if [ "$VALUE" = "b" ] ; then
mkdir -p ~/.vim/plugin/
mkdir -p ~/.vim/backup/
mkdir -p ~/.vim/undo/
mkdir -p ~/.vim/tmp/
mkdir -p ~/.vim/bundle/
mkdir -p ~/.vim/bundle/
echo "Installing vim bundles"
if [ ! -f ~/.vim/plugin/sessionman.vim ]
then
echo "Installing sessionman in ~/.vim/plugin/"
wget -O ~/.vim/plugin/sessionman.vim http://www.vim.org/scripts/download_script.php?src_id=15599
fi
if [ ! -d ~/.vim/bundle/vundle/ ]
then
echo "Installing vundle"
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
fi
vim +BundleInstall +qa
fi
if [ "$VALUE" = "s" ] ; then
echo "Installing server applications:"
echo $(grep -vE "^\s*#" server.txt | tr "\n" " ")
sudo apt-get update;sudo apt-get upgrade;sudo apt-get install $(grep -vE "^\s*#" server.txt | tr "\n" " ")
fi
if [ "$VALUE" = "d" ] ; then
echo "Installing desktop applications"
echo $(grep -vE "^\s*#" desktop.txt | tr "\n" " ")
sudo apt-get update;sudo apt-get upgrade;sudo apt-get install $(grep -vE "^\s*#" desktop.txt | tr "\n" " ")
fi
if [ "$VALUE" = "t" ] ; then
echo "Syncing tmux"
rm ~/.tmux.conf
ln -s ${PWD}/tmux.conf ~/.tmux.conf
fi
if [ "$VALUE" = "c" ] ; then
echo "Syncing config files"
rm ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.gitignore_global ~/.bashrc
ln -s ${PWD}/gitignore_global ~/.gitignore_global
ln -s ${PWD}/vimrc ~/.vimrc
ln -s ${PWD}/vimperatorrc ~/.vimperatorrc
ln -s ${PWD}/gitconfig ~/.gitconfig
ln -s ${PWD}/bashrc ~/.bashrc
fi
done
echo "Done syncing"