david/myzsh
david
/
myzsh
Archived
1
0
Fork 0

pushzshconfig 20.06.2013 17:36

This commit is contained in:
david 2013-06-20 17:36:28 +02:00
parent 6ea8fb2b55
commit f795dd6d18
1 changed files with 19 additions and 22 deletions

View File

@ -80,29 +80,26 @@ update()
issue="$(cat /etc/issue)"
if [ -z $issue ]; then
echo "unknown system (/etc/issue is empty). could not run update."
exit 1
fi
for item in $systems; do
echo $issue | grep -i $item >> /dev/null
if [ $? -eq 0 ]; then
system=$item
fi
done
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
exit $?
;;
arch)
sudo pacman -Syu
exit $?
;;
?)
echo "unknown system. could not run update."
exit 1
;;
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
}