#!/bin/sh
BACKUPDIR=/var/mobile/Library/Preferences

tar kzxPf ${BACKUPDIR}/aptbackup_cydiasources.tgz
apt-get update
dpkg --set-selections < ${BACKUPDIR}/aptbackup_dpkg-packages.txt
apt-get -ymf --force-yes dselect-upgrade

tar zxPf ${BACKUPDIR}/aptbackup_openssh.tgz

#rm -f /var/mobile/Library/Caches/com.apple.mobile.installation.plist
su -c /usr/bin/uicache mobile

rm -f ${BACKUPDIR}/cydia.packages.txt
reboot
