delete works now, stupid nname bug fixed

This commit is contained in:
erdgeist 2005-09-25 12:52:04 +00:00
parent 2fcd7f1a76
commit 2489b53757

View File

@ -67,7 +67,7 @@ create)
# name will be foo_com in most scripts
newjail_name=`echo $newjail_name | tr /~ __`;
newjail_root=${newjail_root:-"$ezjail_jaildir/$newjail_name"}
newjail_nname=`echo $newjail_nname | tr . _`;
newjail_nname=`echo $newjail_name | tr . _`;
# if jail root specified on command line is not absolute,
# make it absolute inside our jail directory
@ -149,24 +149,24 @@ delete)
# fetch information about the jail to be gone
# by parsing our records
. ${ezjail_jailcfgs}/${oldjail_nname}
eval oldjail_root=\"\$jail_${oldjail_nname}_root\"
eval oldjail_rootdir=\"\$jail_${oldjail_nname}_rootdir\"
# now we know everything we need to let the jail be gone
# remove entry from ezjail resource structure
echo rm -f ${ezjail_jailcfgs}/${oldjail_nname}
rm -f ${ezjail_jailcfgs}/${oldjail_nname}
# delete fstab.JAILNAME
echo rm -f /etc/fstab.$oldjail_nname
rm -f /etc/fstab.$oldjail_nname
# if there is a soft link pointing to the jail root, remove it
oldjail_softlink=$ezjail_jaildir/`basename $oldjail_root`
oldjail_softlink=$ezjail_jaildir/`basename $oldjail_rootdir`
if [ -L $oldjail_softlink ]; then
echo rm $oldjail_softlink
rm $oldjail_softlink
fi
# if wiping the jail was requested, remove it
if [ $oldjail_wipe = "YES" ]; then
echo rm -rf $oldjail_root
rm -rf $oldjail_rootdir
fi
;;