1
1
Fork 0

updated zsh_install.sh

This commit is contained in:
David 2012-07-29 15:09:14 +02:00
parent e5e83476f7
commit c2961eb05b
1 changed files with 68 additions and 13 deletions

View File

@ -2,33 +2,88 @@
# install and configure zsh
installdeps()
{
#checking for system
systems="ubuntu arch"
issue="$(cat /etc/issue)"
for item in $systems; do
echo $issue | grep -i $item
if [ $? -eq 0 ]; then
system=$item
fi
done
case $system in
ubuntu)
sudo apt-get update && sudo apt-get install -y curl zsh git-core vim
;;
arch)
sudo pacman -Su git zsh curl vim
;;
?)
echo "unknown system. could not install anything"
;;
esac
}
zshinstall()
{
if [ -d ~/.oh-my-zsh/custom/.git ]; then
echo "skipping zsh installation. is already there."
else
echo "installing curl, zsh and git-core as dependencies of zsh configuration"
sudo apt-get update && sudo apt-get install -y curl zsh git-core
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
rm -rf ~/.oh-my-zsh/custom/
cd ~/.oh-my-zsh/
git clone git://git.socialnerds.org/zshconfig.git custom
rm -rf ~/.oh-my-zsh/
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
rm -rf ~/.oh-my-zsh/custom/
cd ~/.oh-my-zsh/
choice="null"
while [ $choice != "y" ] && [ $choice != "n" ]; do
echo ""
read -p "now modify your ~/.zshrc to your needs"
vi ~/.zshrc
read -p "should i clone the zshconfig writeable? [y/n]" choice
if [ $choice = "y" ]; then
git clone git@git.socialnerds.org:zshconfig.git custom
else
git clone git://git.socialnerds.org/zshconfig.git custom
fi
done
echo ""
read -p "now modify your ~/.zshrc to your needs"
vim ~/.zshrc
cat /etc/passwd | grep ~ | grep "/bin/zsh"
#set default shell if not set already
if [ $? -eq 1 ]; then
echo ""
read -p "time to change your default shell to /bin/zsh"
sudo vi /etc/passwd
sudo vim /etc/passwd
fi
}
#start of script
zshinstall
if [ -d ~/.oh-my-zsh/custom/.git ]; then
echo ""
echo "skipping zsh installation. it is already there."
echo ""
read -p "do you want to cleanup and reinstall? [y/n]" choice
if [ $choice = "y" ]; then
installdeps
zshinstall
else
echo "updating instead..."
cd ~/.oh-my-zsh/custom
git pull origin master
fi
else
installdeps
zshinstall
fi
#end of file