#!/bin/sh

if [ "$1" = "test" ]; then
  echo "Repair broken packages"
  exit 0
fi

# do some cleanup
rm /var/lib/apt/lists/partial/*

# now run the apt foo
dpkg --configure -a
apt-get update
apt-get install -f
apt-get dist-upgrade

echo ""
echo "Finished, please press ENTER"
read TMP

exit 0
