Network error message now working

This commit is contained in:
lhark 2015-06-09 12:49:03 +02:00
parent 2b7682cf9d
commit 5c9b82d6b5

6
zshrc
View file

@ -15,9 +15,9 @@ export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:~/bin
# Mise à jour automatique à partir du repo distant # Mise à jour automatique à partir du repo distant
cd /home/$USER/rc cd /home/$USER/rc
# In case the network is down, don't lock the terminal # In case the network is down, don't lock the terminal
timeout 3 git fetch timeout 3 git fetch > /dev/null 2>&1
if [ $? = 124 ] then if [ "$?" -ge "124" ]; then
echo "Unable to reach $(git remote -v)" echo "Unable to reach $(git remote -v | grep "fetch")"
fi fi
git_st=$(command git status --porcelain -b 2> /dev/null) git_st=$(command git status --porcelain -b 2> /dev/null)
if $(echo "$git_st" | grep '^## .*ahead' &> /dev/null); then if $(echo "$git_st" | grep '^## .*ahead' &> /dev/null); then