_ may be replaced by _, avoid identical variable names
This commit is contained in:
parent
159b4a8c83
commit
c5753e553f
@ -70,9 +70,13 @@ create)
|
|||||||
# foo_com in most scripts
|
# foo_com in most scripts
|
||||||
|
|
||||||
newjail_name=`echo -n ${newjail_name} | tr /~ __`
|
newjail_name=`echo -n ${newjail_name} | tr /~ __`
|
||||||
newjail_nname=`echo -n "${newjail_name}" | tr -c [:alnum:]_ _`
|
newjail_nname=`echo -n "${newjail_name}" | tr -c [:alnum:] _`
|
||||||
newjail_root=${newjail_root:-"${ezjail_jaildir}/${newjail_name}"}
|
newjail_root=${newjail_root:-"${ezjail_jaildir}/${newjail_name}"}
|
||||||
|
|
||||||
|
# jail names may lead to identical configs, eg. foo.bar.com == foo-bar.com
|
||||||
|
# so check, whether we might be running into problems
|
||||||
|
[ -e ${ezjail_jailcfgs}/${newjail_nname} ] && exerr "Error: an ezjail config already exists at ${ezjail_jailcfgs}/${newjail_nname}. Please rename the ezjail."
|
||||||
|
|
||||||
# if jail root specified on command line is not absolute,
|
# if jail root specified on command line is not absolute,
|
||||||
# make it absolute inside our jail directory
|
# make it absolute inside our jail directory
|
||||||
[ ${newjail_root#/} = ${newjail_root} ] && newjail_root=${ezjail_jaildir}/${newjail_root}
|
[ ${newjail_root#/} = ${newjail_root} ] && newjail_root=${ezjail_jaildir}/${newjail_root}
|
||||||
@ -176,7 +180,7 @@ delete)
|
|||||||
[ "${oldjail_name}" -a $# = 1 ] || exerr 'Usage: ezjail delete [-w] jailname'
|
[ "${oldjail_name}" -a $# = 1 ] || exerr 'Usage: ezjail delete [-w] jailname'
|
||||||
|
|
||||||
# tidy up jail name the ezjail way
|
# tidy up jail name the ezjail way
|
||||||
oldjail_nname=`echo -n ${oldjail_name} | tr -c [:alnum:]_ _`;
|
oldjail_nname=`echo -n ${oldjail_name} | tr -c [:alnum:] _`;
|
||||||
|
|
||||||
# check for existence of jail in our records
|
# check for existence of jail in our records
|
||||||
[ -f ${ezjail_jailcfgs}/${oldjail_nname} ] || exerr "Error: Nothing known about jail ${oldjail_name}."
|
[ -f ${ezjail_jailcfgs}/${oldjail_nname} ] || exerr "Error: Nothing known about jail ${oldjail_name}."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user