comparison sbin/ftjail @ 443:071f24359eef

Move "_ensure_no_optios()" into common.subr
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 03 May 2024 09:41:38 +0200
parents 9c3b1966ba91
children 84e43d1bd128
comparison
equal deleted inserted replaced
442:a2011285f054 443:071f24359eef
54 54
55 All commands with the exception of "populate-tmpl" require ZFS as 55 All commands with the exception of "populate-tmpl" require ZFS as
56 filesystem. 56 filesystem.
57 ' 57 '
58 58
59
60 _p_datadir="$(dirname "$0")"/../share/local-bsdtools
61 . "${_p_datadir}/common.subr"
62
63
59 # Reset to standard umask 64 # Reset to standard umask
60 umask 0022 65 umask 0022
61
62
63 #:
64 #: Ensure that no command line options are given
65 #:
66 #: Args:
67 #: $@:
68 #:
69 #: Exit:
70 #: 2: If formally `getopts` finds options in "$@"
71 #:
72 #: Return:
73 #: - 0
74 #:
75 _ensure_no_options() {
76 local _opt
77
78 while getopts ":" _opt ; do
79 [ "${_opt}" = '?' ] && { echo "ERROR: no option allowed" 1>&2; exit 2; }
80 done
81 return 0
82 }
83 66
84 67
85 _get_dataset_for_mountpoint() { 68 _get_dataset_for_mountpoint() {
86 : 'Use `mount -t zfs -p` to determine the ZFS dataset for a given mountpoint. 69 : 'Use `mount -t zfs -p` to determine the ZFS dataset for a given mountpoint.
87 70