Split off ZFS-relatesd tasks into 'zfs.sh'

This commit is contained in:
2025-12-24 16:36:33 -05:00
parent 30b3b58336
commit 8414563171
2 changed files with 25 additions and 9 deletions

22
zfs.sh
View File

@@ -272,3 +272,25 @@ fi
# zfs mount \
# ${hostname,,}/var/mail
# fi
if [[ "${1}" == '--key' ]]; then
cp \
/etc/zfs/keys/${hostname,,}.key \
/mnt/etc/zfs/keys/
elif [[ "${1}" == '--unmount' ]]; then
mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' | xargs -I {} umount -Rlf {}
if [[ "${ID}" == 'fedora' ]]; then
umount \
-nR \
/mnt
fi
zpool \
export \
-a
elif [[ "${1}" == '--host-id' ]]; then
zgenhostid \
-f \
0x00bab10c
fi