Compare commits

..
2 Commits
Author SHA1 Message Date
Sean 6558be3494 tweaks 2019-08-02 12:08:01 -07:00
Sean 1a981e96eb tweaks 2019-08-02 12:07:38 -07:00
+9 -2
View File
@@ -36,7 +36,14 @@ echo "Entering chroot..."
echo "Please execute \"mount /boot\" to access boot partition, type exit to leave:" echo "Please execute \"mount /boot\" to access boot partition, type exit to leave:"
echo "" echo ""
chroot /mnt /bin/bash --login < /dev/tty echo "#!/bin/bash" > /mnt/maintenance.sh
chmod +x /mnt/maintenance.sh
echo "zfs mount -a && mount /boot" >> /mnt/maintenance.sh
echo "/bin/bash" >> /mnt/maintenance.sh
chroot /mnt /maintenance.sh --login < /dev/tty
rm /mnt/maintenance.sh
if ! [ "$?" = "0" ]; then if ! [ "$?" = "0" ]; then
echo "Chroot failed with an error" echo "Chroot failed with an error"
@@ -47,7 +54,7 @@ fi
echo "" echo ""
echo "Unbinding mounts..." echo "Unbinding mounts..."
errors=$(mount | grep -v zfs | tac | awk '/\/mnt/ {print \$3}' | xargs -i{} umount -lf {} 2>&1 1>/dev/null && zpool export -a 2>&1 1>/dev/null) errors=$(mount | grep -v zfs | tac | awk '/\\/mnt/ {print \$3}' | xargs -i{} umount -lf {} 2>&1 1>/dev/null && zpool export -a 2>&1 1>/dev/null)
if ! [ "$?" = "0" ]; then if ! [ "$?" = "0" ]; then
echo "Failed to unbind mounts - $errors" echo "Failed to unbind mounts - $errors"
exit 4 exit 4