_ may be replaced by _, avoid identical variable names

This commit is contained in:
erdgeist 2006-02-02 22:55:33 +00:00
parent 159b4a8c83
commit c5753e553f

View File

@ -70,9 +70,13 @@ create)
# foo_com in most scripts
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}"}
# 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,
# make it absolute inside our jail directory
[ ${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'
# 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
[ -f ${ezjail_jailcfgs}/${oldjail_nname} ] || exerr "Error: Nothing known about jail ${oldjail_name}."