diff options
author | Patrick Simianer <pks@pks.rocks> | 2018-05-26 13:19:06 +0200 |
---|---|---|
committer | Patrick Simianer <pks@pks.rocks> | 2018-05-26 13:19:06 +0200 |
commit | 621e4da7236a107ef9267847281dbecb7ed3236a (patch) | |
tree | ffda9f596e95045326156ea2c6dd442126de10ba /upgrade-gentoo | |
parent | c7338422f28ac98d0d38ebf5b593ae70e98f0bda (diff) |
upgrade-gentoo: compatibility for other hosts
Diffstat (limited to 'upgrade-gentoo')
-rwxr-xr-x | upgrade-gentoo | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/upgrade-gentoo b/upgrade-gentoo index ec1cd76..e26f575 100755 --- a/upgrade-gentoo +++ b/upgrade-gentoo @@ -1,18 +1,23 @@ #!/bin/zsh -if grep -qs '/media/ext_sd' /proc/mounts; then - mount -o remount,exec,nouser,nousers /media/ext_sd - mkdir /media/ext_sd/tmp - chmod 777 /media/ext_sd/tmp -else - echo "External disk not mounted, exiting." - exit +HOST=$(hostname) + +if [[ $HOST == "bogues" ]]; then + if grep -qs '/media/ext_sd' /proc/mounts; then + mount -o remount,exec,nouser,nousers /media/ext_sd + mkdir /media/ext_sd/tmp + chmod 777 /media/ext_sd/tmp + else + echo "External disk not mounted, exiting." + exit + fi + cd /usr + rsync -avv portage/ portage_/ + umount portage + rm portage.squashfs + mv portage_ portage fi -cd /usr -rsync -avv portage/ portage_/ -umount portage -rm portage.squashfs -mv portage_ portage + perl-cleaner --reallyall emaint --check all emaint --fix all @@ -25,10 +30,13 @@ 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/ext_sd/tmp -mount -o remount,users,auto /media/ext_sd + +if [[ $HOST == "bogues" ]]; then + mksquashfs portage portage.squashfs -comp xz + rm -rf /usr/portage + mkdir /usr/portage + mount portage + rm -r /media/ext_sd/tmp + mount -o remount,users,auto /media/ext_sd +fi |