autopush by david@ghost
This commit is contained in:
parent
b83f82795a
commit
37750eb8a3
28
install.sh
28
install.sh
|
@ -25,7 +25,7 @@ installdeps()
|
||||||
if [ $i -ne 0 ]; then
|
if [ $i -ne 0 ]; then
|
||||||
|
|
||||||
#checking for system
|
#checking for system
|
||||||
readonly systems="ubuntu arch"
|
readonly systems="ubuntu arch raspbian solus"
|
||||||
issue="$(cat /etc/issue)"
|
issue="$(cat /etc/issue)"
|
||||||
for item in $systems; do
|
for item in $systems; do
|
||||||
echo $issue | grep -i $item
|
echo $issue | grep -i $item
|
||||||
|
@ -41,8 +41,16 @@ installdeps()
|
||||||
arch)
|
arch)
|
||||||
sudo pacman -Su $missingdeps
|
sudo pacman -Su $missingdeps
|
||||||
;;
|
;;
|
||||||
|
raspbian)
|
||||||
|
sudo apt-get update && sudo apt-get install -y $missingdeps
|
||||||
|
;;
|
||||||
|
solus)
|
||||||
|
sudo eopkg update-repo && sudo eopkg install $missingdeps
|
||||||
|
;;
|
||||||
|
|
||||||
?)
|
?)
|
||||||
echo "unknown system. could not install anything"
|
echo "[myzsh]: i cannot install dependencies. unknown system."
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -58,7 +66,7 @@ installmyzsh()
|
||||||
choice="null"
|
choice="null"
|
||||||
while [ $choice != "y" ] && [ $choice != "n" ]; do
|
while [ $choice != "y" ] && [ $choice != "n" ]; do
|
||||||
echo ""
|
echo ""
|
||||||
read -p "should i clone myzsh writeable? [y/n]" choice
|
read -p "[myzsh]: should i clone myzsh writeable? [y/n]" choice
|
||||||
if [ $choice = "y" ]; then
|
if [ $choice = "y" ]; then
|
||||||
git clone git@socialg.it:david/myzsh.git ~/.myzsh
|
git clone git@socialg.it:david/myzsh.git ~/.myzsh
|
||||||
else
|
else
|
||||||
|
@ -70,13 +78,11 @@ installmyzsh()
|
||||||
echo 'plugins=(david)' >> ~/.zshrc
|
echo 'plugins=(david)' >> ~/.zshrc
|
||||||
echo 'source $ZSH/myzsh.sh' >> ~/.zshrc
|
echo 'source $ZSH/myzsh.sh' >> ~/.zshrc
|
||||||
echo "export PATH=$PATH" >> ~/.zshrc
|
echo "export PATH=$PATH" >> ~/.zshrc
|
||||||
# read -p "now modify your ~/.zshrc to your needs"
|
|
||||||
# vim ~/.zshrc
|
|
||||||
|
|
||||||
cat /etc/passwd | grep ~ | grep "/bin/zsh"
|
cat /etc/passwd | grep ~ | grep "/bin/zsh"
|
||||||
#set default shell if not set already
|
#set default shell if not set already
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
read -p "time to change your default shell to /bin/zsh"
|
read -p "[myzsh]: time to change your default shell to /bin/zsh"
|
||||||
sudo vim /etc/passwd
|
sudo vim /etc/passwd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -88,22 +94,22 @@ installmyzsh()
|
||||||
|
|
||||||
if [ -d ~/.myzsh ]; then
|
if [ -d ~/.myzsh ]; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "skipping myzsh installation. it is already there."
|
echo "[myzsh]: it seems i have already been setup."
|
||||||
echo ""
|
echo ""
|
||||||
read -p "do you want to cleanup and reinstall? [y/n]" choice
|
read -p "[myzsh]: should i cleanup and reinstall? [y/n]" choice
|
||||||
if [ $choice = "y" ]; then
|
if [ $choice = "y" ]; then
|
||||||
installdeps
|
installdeps
|
||||||
removeohmyzsh
|
#removeohmyzsh
|
||||||
installmyzsh
|
installmyzsh
|
||||||
else
|
else
|
||||||
echo "updating instead..."
|
echo "[myzsh]: updating instead."
|
||||||
cd ~/.myzsh
|
cd ~/.myzsh
|
||||||
git pull origin master
|
git pull origin master
|
||||||
cd -
|
cd -
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
installdeps
|
installdeps
|
||||||
removeohmyzsh
|
#removeohmyzsh
|
||||||
installmyzsh
|
installmyzsh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Reference in New Issue