comparison sbin/ftjail @ 629:f7eda6256ae8

ftjail: remove useless "cat" and replace by input redirection
author Franz Glasner <fzglas.hg@dom66.de>
date Tue, 24 Sep 2024 18:47:45 +0200
parents 17209ce80536
children 87d37db3ac06
comparison
equal deleted inserted replaced
628:17209ce80536 629:f7eda6256ae8
1034 # XXX FIXME: Re-create the current mode bits and/or ACLs also. 1034 # XXX FIXME: Re-create the current mode bits and/or ACLs also.
1035 # But most probably they are set properly in the mounted 1035 # But most probably they are set properly in the mounted
1036 # datasets. 1036 # datasets.
1037 # 1037 #
1038 echo "Recreating missing top-level directories" 1038 echo "Recreating missing top-level directories"
1039 cat "${_dir_fn_tldir}" \ 1039 while IFS='' read -r _line ; do
1040 | { 1040 if [ ! -d "${_line}" ]; then
1041 while IFS='' read -r _line ; do 1041 echo "Recreating top-level directory: ${_line}"
1042 if [ ! -d "${_line}" ]; then 1042 mkdir "${_line}"
1043 echo "Recreating top-level directory: ${_line}" 1043 fi
1044 mkdir "${_line}" 1044 done < "${_dir_fn_tldir}"
1045 fi
1046 done
1047 }
1048 echo "Unmounting the new root dataset" 1045 echo "Unmounting the new root dataset"
1049 /sbin/umount "${_directory}" 1046 /sbin/umount "${_directory}"
1050 echo "Re-setting some ZFS properties on the new cloned dataset" 1047 echo "Re-setting some ZFS properties on the new cloned dataset"
1051 zfs set readonly=on "${_root_dataset}" 1048 zfs set readonly=on "${_root_dataset}"
1052 # 1049 #