delete works now, stupid nname bug fixed
This commit is contained in:
parent
2fcd7f1a76
commit
2489b53757
14
ezjail-admin
14
ezjail-admin
@ -67,7 +67,7 @@ create)
|
|||||||
# name will be foo_com in most scripts
|
# name will be foo_com in most scripts
|
||||||
newjail_name=`echo $newjail_name | tr /~ __`;
|
newjail_name=`echo $newjail_name | tr /~ __`;
|
||||||
newjail_root=${newjail_root:-"$ezjail_jaildir/$newjail_name"}
|
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,
|
# if jail root specified on command line is not absolute,
|
||||||
# make it absolute inside our jail directory
|
# make it absolute inside our jail directory
|
||||||
@ -149,24 +149,24 @@ delete)
|
|||||||
# fetch information about the jail to be gone
|
# fetch information about the jail to be gone
|
||||||
# by parsing our records
|
# by parsing our records
|
||||||
. ${ezjail_jailcfgs}/${oldjail_nname}
|
. ${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
|
# now we know everything we need to let the jail be gone
|
||||||
# remove entry from ezjail resource structure
|
# remove entry from ezjail resource structure
|
||||||
echo rm -f ${ezjail_jailcfgs}/${oldjail_nname}
|
rm -f ${ezjail_jailcfgs}/${oldjail_nname}
|
||||||
|
|
||||||
# delete fstab.JAILNAME
|
# 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
|
# 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
|
if [ -L $oldjail_softlink ]; then
|
||||||
echo rm $oldjail_softlink
|
rm $oldjail_softlink
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if wiping the jail was requested, remove it
|
# if wiping the jail was requested, remove it
|
||||||
if [ $oldjail_wipe = "YES" ]; then
|
if [ $oldjail_wipe = "YES" ]; then
|
||||||
echo rm -rf $oldjail_root
|
rm -rf $oldjail_rootdir
|
||||||
fi
|
fi
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user