CLOUDSTACK-7143: cleanup apt_upgrade.sh code

This commit is contained in:
Leo Simons 2014-07-21 10:58:57 +02:00 committed by Rohit Yadav
parent 6641fd3a76
commit 58ca92ce52
1 changed files with 16 additions and 10 deletions

View File

@ -1,15 +1,21 @@
# Update the box
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
set -e
set -x
add_backports () {
sed -i '/backports/d' /etc/apt/sources.list
echo 'deb http://http.us.debian.org/debian wheezy-backports main' >> /etc/apt/sources.list
function add_backports() {
sed -i '/backports/d' /etc/apt/sources.list
echo 'deb http://http.us.debian.org/debian wheezy-backports main' >> /etc/apt/sources.list
}
add_backports
function apt_upgrade() {
DEBIAN_FRONTEND=noninteractive
DEBIAN_PRIORITY=critical
apt-get -q -y --force-yes update
apt-get -q -y --force-yes install curl unzip
apt-get clean
add_backports
apt-get -q -y --force-yes update
apt-get -q -y --force-yes upgrade
}
return 2>/dev/null || apt_upgrade