#!/bin/zsh if grep -qs '/media/dock' /proc/mounts; then mkdir /media/dock/tmp chmod 777 /media/dock/tmp else echo "External disk not mounted, exiting." exit fi cd /usr rsync -avv portage/ portage_/ umount portage rm portage.squashfs mv portage_ portage perl-cleaner --reallyall python-updater emaint --check all emaint --fix all emerge --sync emerge -avuDN --with-bdeps y --keep-going world echo "-------------------------" read p\?"press enter to continue... " etc-update emerge -av --depclean revdep-rebuild eclean -d distfiles localepurge mksquashfs portage portage.squashfs -comp xz rm -rf /usr/portage mkdir /usr/portage mount portage rm -r /media/dock/tmp