diff options
author | erdgeist <erdgeist@erdgeist.org> | 2005-11-09 01:24:59 +0000 |
---|---|---|
committer | erdgeist <erdgeist@erdgeist.org> | 2005-11-09 01:24:59 +0000 |
commit | 8bf893f2a2aa7fe84191c614c458b3cab004ca73 (patch) | |
tree | dfcb4a7613fadb34988005ae4a4d90ff489b8ee9 /ezjail-admin | |
parent | cb9940f7341d63e385d804464fb1939de9a4e6e1 (diff) |
Check if jail is still running before removing it
Diffstat (limited to 'ezjail-admin')
-rwxr-xr-x | ezjail-admin | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ezjail-admin b/ezjail-admin index ef15668..e53e01b 100755 --- a/ezjail-admin +++ b/ezjail-admin | |||
@@ -164,6 +164,13 @@ delete) | |||
164 | . ${ezjail_jailcfgs}/${oldjail_nname} | 164 | . ${ezjail_jailcfgs}/${oldjail_nname} |
165 | eval oldjail_rootdir=\"\$jail_${oldjail_nname}_rootdir\" | 165 | eval oldjail_rootdir=\"\$jail_${oldjail_nname}_rootdir\" |
166 | 166 | ||
167 | # if jail is still running, refuse to go any further | ||
168 | if [ -f /var/run/jail_${oldjail_nname}.id ]; then | ||
169 | echo "Error: Jail appears to be still running, stop it first" | ||
170 | echo "(/var/run/jail_${oldjail_nname}.id exists)" | ||
171 | exit 1; | ||
172 | fi | ||
173 | |||
167 | # now we know everything we need to let the jail be gone | 174 | # now we know everything we need to let the jail be gone |
168 | # remove entry from ezjail resource structure | 175 | # remove entry from ezjail resource structure |
169 | rm -f ${ezjail_jailcfgs}/${oldjail_nname} | 176 | rm -f ${ezjail_jailcfgs}/${oldjail_nname} |