david/myzsh
david
/
myzsh
Archived
1
0
Fork 0

Merge branch 'master' of github.com:beyondthewall/myzsh

This commit is contained in:
david 2013-06-20 19:00:08 +02:00
commit ed05a85ad8
1 changed files with 21 additions and 17 deletions

View File

@ -80,24 +80,28 @@ update()
#checking for system
systems="ubuntu arch"
issue="$(cat /etc/issue)"
for item in $systems; do
echo $issue | grep -i $item > /dev/null
if [ $? -eq 0 ]; then
system=$item
fi
done
if [ -z $issue ]; then
echo "unknown system (/etc/issue is empty). could not run update."
else
for item in $systems; do
echo $issue | grep -i $item >> /dev/null
if [ $? -eq 0 ]; then
system=$item
fi
done
case $system in
ubuntu)
sudo apt-get update && sudo apt-get dist-upgrade
;;
arch)
sudo pacman -Syu
;;
?)
echo "unknown system. could not run update."
;;
esac
case $system in
ubuntu)
sudo apt-get update && sudo apt-get dist-upgrade
;;
arch)
sudo pacman -Syu
;;
?)
echo "unknown system. could not run update."
;;
esac
fi
}