comparison sbin/ftjail @ 556:a593dce19f54

ftjail: FIX: do not append to a fstab but overwrite completely
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 11 Sep 2024 12:59:16 +0200
parents 2fda9ab57359
children 3afebbaf613b
comparison
equal deleted inserted replaced
555:2fda9ab57359 556:a593dce19f54
996 # XXX FIXME: handle spaces in device and mountpoint names: replace 996 # XXX FIXME: handle spaces in device and mountpoint names: replace
997 # with a literal `\040'. Note that ${_dir_mounts} is 997 # with a literal `\040'. Note that ${_dir_mounts} is
998 # normalized already: it uses TAB characters as field 998 # normalized already: it uses TAB characters as field
999 # separator exclusively. 999 # separator exclusively.
1000 # 1000 #
1001 printf '%s' "${_dir_mounts}" >>"${_dir_fn_fstab}" 1001 printf '%s' "${_dir_mounts}" >"${_dir_fn_fstab}"
1002 _dir_fn_tldir="${_u_tmpdir}/tldirs" 1002 _dir_fn_tldir="${_u_tmpdir}/tldirs"
1003 LC_ALL=C /usr/bin/find "${_directory}" -depth 1 -type d 2>/dev/null | LC_ALL=C /usr/bin/sort >>"${_dir_fn_tldir}" 1003 LC_ALL=C /usr/bin/find "${_directory}" -depth 1 -type d 2>/dev/null | LC_ALL=C /usr/bin/sort >>"${_dir_fn_tldir}"
1004 1004
1005 # Unmount in reverse order: unmount can do it for us 1005 # Unmount in reverse order: unmount can do it for us
1006 echo "Unmounting all datasets mounted at \`${_directory}'" 1006 echo "Unmounting all datasets mounted at \`${_directory}'"