diff options
-rwxr-xr-x | ezjail.sh | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -101,7 +101,12 @@ attach_detach_pre () | |||
101 | if [ -L "${ezjail_rootdir}.device" ]; then | 101 | if [ -L "${ezjail_rootdir}.device" ]; then |
102 | # Fetch destination of soft link | 102 | # Fetch destination of soft link |
103 | ezjail_device=`stat -f "%Y" ${ezjail_rootdir}.device` | 103 | ezjail_device=`stat -f "%Y" ${ezjail_rootdir}.device` |
104 | [ -e "${ezjail_device}" ] && echo "Jail image file ${ezjail} already attached as ${ezjail_device}. 'ezjail-admin config -i detach' it first." && return 1 | 104 | |
105 | mount -p -v | grep -E "^${ezjail_rootdir}.device.${ezjail_rootdir}" && echo "Jail image file ${ezjail} already attached as ${ezjail_device}. 'ezjail-admin config -i detach' it first." && return 1 | ||
106 | mount -p -v | grep -E "^${ezjail_device}.${ezjail_rootdir}" && echo "Jail image file ${ezjail} already attached as ${ezjail_device}. 'ezjail-admin config -i detach' it first." && return 1 | ||
107 | |||
108 | # Remove stale device link | ||
109 | rm -f ${ezjail_rootdir}.device | ||
105 | fi | 110 | fi |
106 | 111 | ||
107 | # Create a memory disc from jail image | 112 | # Create a memory disc from jail image |