summaryrefslogtreecommitdiff
path: root/ezjail-admin
diff options
context:
space:
mode:
Diffstat (limited to 'ezjail-admin')
-rwxr-xr-xezjail-admin12
1 files changed, 6 insertions, 6 deletions
diff --git a/ezjail-admin b/ezjail-admin
index b2f56e8..741d4cd 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -29,7 +29,7 @@ ezjail_fdescfs_enable=${ezjail_fdescfs_enable:-"YES"}
29exerr () { echo -e "$*"; exit 1; } 29exerr () { echo -e "$*"; exit 1; }
30 30
31# check for command 31# check for command
32[ $1 ] || exerr "Usage: `basename -- $0` [create|delete|list|update] {params}" 32[ "$1" ] || exerr "Usage: `basename -- $0` [create|delete|list|update] {params}"
33 33
34case "$1" in 34case "$1" in
35######################## ezjail-admin CREATE ######################## 35######################## ezjail-admin CREATE ########################
@@ -61,7 +61,7 @@ create)
61 [ -d ${ezjail_jailbase} ] || exerr "Error: base jail does not exist. Please run 'ezjail-admin update' first." 61 [ -d ${ezjail_jailbase} ] || exerr "Error: base jail does not exist. Please run 'ezjail-admin update' first."
62 62
63 # relative paths don't make sense in rc.scripts 63 # relative paths don't make sense in rc.scripts
64 [ ${ezjail_jaildir%%[!/]*} ] || exerr "Error: Need an absolute path in ezjail_jaildir, it currently is set to: ${ezjail_jaildir}." 64 [ "${ezjail_jaildir%%[!/]*}" ] || exerr "Error: Need an absolute path in ezjail_jaildir, it currently is set to: ${ezjail_jaildir}."
65 65
66 # jail names must not irritate file systems, excluding dots from this list 66 # jail names must not irritate file systems, excluding dots from this list
67 # was done intentionally to permit foo.com style directory names, however, 67 # was done intentionally to permit foo.com style directory names, however,
@@ -77,7 +77,7 @@ create)
77 77
78 # if jail root specified on command line is not absolute, make it absolute 78 # if jail root specified on command line is not absolute, make it absolute
79 # inside our jail directory 79 # inside our jail directory
80 [ ${newjail_root%%[!/]*} ] || newjail_root=${ezjail_jaildir}/${newjail_root} 80 [ "${newjail_root%%[!/]*}" ] || newjail_root=${ezjail_jaildir}/${newjail_root}
81 81
82 # if a directory at the specified jail root already exists, refuse to 82 # if a directory at the specified jail root already exists, refuse to
83 # install 83 # install
@@ -105,7 +105,7 @@ create)
105 fi 105 fi
106 106
107 # if a soft link is necessary, create it now 107 # if a soft link is necessary, create it now
108 [ ${newjail_softlink} ] && ln -s ${newjail_root} ${newjail_softlink} 108 [ "${newjail_softlink}" ] && ln -s ${newjail_root} ${newjail_softlink}
109 109
110 # if the automount feature is not disabled, this fstab entry for new jail 110 # if the automount feature is not disabled, this fstab entry for new jail
111 # will be obeyed 111 # will be obeyed
@@ -125,7 +125,7 @@ create)
125 echo export jail_${newjail_nname}_fdescfs_enable=\"${ezjail_fdescfs_enable}\" >> ${ezjail_jailcfgs}/${newjail_nname} 125 echo export jail_${newjail_nname}_fdescfs_enable=\"${ezjail_fdescfs_enable}\" >> ${ezjail_jailcfgs}/${newjail_nname}
126 126
127 # Final steps for flavour installation 127 # Final steps for flavour installation
128 if [ ${newjail_flavour} ]; then 128 if [ "${newjail_flavour}" ]; then
129 # install files and config to new jail 129 # install files and config to new jail
130 cd ${ezjail_flavours}/${newjail_flavour} 130 cd ${ezjail_flavours}/${newjail_flavour}
131 find * | cpio -p -v ${newjail_root} > /dev/null 131 find * | cpio -p -v ${newjail_root} > /dev/null
@@ -198,7 +198,7 @@ delete)
198 [ -L ${oldjail_softlink} ] && rm ${oldjail_softlink} 198 [ -L ${oldjail_softlink} ] && rm ${oldjail_softlink}
199 199
200 # if wiping the jail was requested, remove it 200 # if wiping the jail was requested, remove it
201 [ ${oldjail_wipe} ] && rm -rf ${oldjail_rootdir} 201 [ "${oldjail_wipe}" ] && rm -rf ${oldjail_rootdir}
202 202
203 ;; 203 ;;
204######################## ezjail-admin LIST ######################## 204######################## ezjail-admin LIST ########################