diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2007-03-23 15:45:35 +0000 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2007-03-23 15:45:35 +0000 |
| commit | 59dde63a40f176a9e0dbebd6ec49edd4a32199f9 (patch) | |
| tree | 53435cc768ada44d8a39358016a109c617bb9793 | |
| parent | a6e66c0450f0ff3c6b66bce24c422f7f45b55704 (diff) | |
Stale device link detection for image devices. Heads up. Untested.
| -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 |
