dotfiles/overlays/rolling_datasets/bin/mount_datasets
magic_rb 23c7002368
Mount old versions of home on omen
Signed-off-by: magic_rb <richard@brezak.sk>
2023-10-18 14:30:17 +02:00

19 lines
415 B
Bash

# -*- mode: shell-script -*-
source @out@/share/functions/get_old_datasets
export "PATH=$PATH:@runtimePath@"
if [[ "$#" != 2 ]] ; then
echo "This script requires precisely 2 arguments!"
exit 1
fi
dataset="$1"
mountpoint="$2"
while IFS="\n" read gen
do
mountpoint -q "$mountpoint/$gen" || mount -o x-mount.mkdir -v -t zfs "$dataset/$gen" "$mountpoint/$gen"
done <<< "$(get_old_datasets "$dataset")"