summaryrefslogtreecommitdiff
path: root/ezjail.sh
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2007-03-23 15:45:35 +0000
committererdgeist <erdgeist@erdgeist.org>2007-03-23 15:45:35 +0000
commit59dde63a40f176a9e0dbebd6ec49edd4a32199f9 (patch)
tree53435cc768ada44d8a39358016a109c617bb9793 /ezjail.sh
parenta6e66c0450f0ff3c6b66bce24c422f7f45b55704 (diff)
Stale device link detection for image devices. Heads up. Untested.
Diffstat (limited to 'ezjail.sh')
-rwxr-xr-xezjail.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/ezjail.sh b/ezjail.sh
index 2751ea0..9f181f2 100755
--- a/ezjail.sh
+++ b/ezjail.sh
@@ -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