comparison bin/fjail @ 75:2e3ac70bdfc8

A fairly usable usage message
author Franz Glasner <hg@dom66.de>
date Thu, 15 Aug 2019 16:07:53 +0200
parents 247d35f910ca
children fea2ef3ff89a
comparison
equal deleted inserted replaced
74:247d35f910ca 75:2e3ac70bdfc8
3 # @(#)$HGid$ 3 # @(#)$HGid$
4 4
5 set -eu 5 set -eu
6 6
7 VERSION="@@VERSION@@" 7 VERSION="@@VERSION@@"
8
9 USAGE="
10 USAGE: fjail [ OPTIONS ] COMMAND [ COMMAND OPTIONS ] [ ARG ... ]
11
12 OPTIONS:
13
14 -h Print this help message to stdout and exit
15
16 COMMANDS:
17
18 datasets [-u] PARENT CHILD
19
20 Create ZFS datasets to be used within a jail
21
22 PARENT must exist already and CHILD must not exist.
23
24 -u Do not automatically mount newly created datasets
25
26 privs MOUNTPOINT
27
28 Adjust some Unix privileges to mounted jail datasets
29 "
30
8 31
9 # Reset to standard umask 32 # Reset to standard umask
10 umask 0022 33 umask 0022
11 34
12 35
123 # Global option handling 146 # Global option handling
124 # 147 #
125 while getopts "h" _opt ; do 148 while getopts "h" _opt ; do
126 case ${_opt} in 149 case ${_opt} in
127 h) 150 h)
128 echo "Usage: XXX TBD" 151 echo "${USAGE}"
129 exit 0 152 exit 0
130 ;; 153 ;;
131 \?|:) 154 \?|:)
132 exit 2; 155 exit 2;
133 ;; 156 ;;