comparison sbin/fjail @ 699:4243b087fc2d

fjail: Check simple result directly
author Franz Glasner <fzglas.hg@dom66.de>
date Tue, 01 Oct 2024 20:05:36 +0200
parents f8bd9471345a
children 31953a5653e9
comparison
equal deleted inserted replaced
698:f8bd9471345a 699:4243b087fc2d
580 # 580 #
581 # Handle <mountpoint>/var/empty specially: 581 # Handle <mountpoint>/var/empty specially:
582 # make it writeable temporarily if it is mounted read-only: 582 # make it writeable temporarily if it is mounted read-only:
583 # 583 #
584 _vestatus="" 584 _vestatus=""
585 _veds="$(_get_zfs_dataset_for_varempty "${_mp}")" 585 if _veds="$(_get_zfs_dataset_for_varempty "${_mp}")" ; then
586 if [ $? -eq 0 ]; then
587 _vestatus=$(zfs list -H -o readonly -t filesystem ${_veds} 2>/dev/null) || { echo "ERROR: cannot determine readonly status of ${_mp}/var/empty" >&2; return 1; } 586 _vestatus=$(zfs list -H -o readonly -t filesystem ${_veds} 2>/dev/null) || { echo "ERROR: cannot determine readonly status of ${_mp}/var/empty" >&2; return 1; }
588 if [ "${_vestatus}" = "on" ]; then 587 if [ "${_vestatus}" = "on" ]; then
589 zfs set readonly=off ${_veds} 1> /dev/null || { echo "ERROR: cannot reset readonly-status of ${_mp}/var/empty" >&2; return 1; } 588 zfs set readonly=off ${_veds} 1> /dev/null || { echo "ERROR: cannot reset readonly-status of ${_mp}/var/empty" >&2; return 1; }
590 fi 589 fi
591 fi 590 fi