summaryrefslogtreecommitdiffstats
path: root/setup-named-chroot.sh
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2012-04-26 13:34:29 +0200
committerAdam Tkac <atkac@redhat.com>2012-04-26 13:34:29 +0200
commit773ac2b8b36f1011207d5de13b5c5b1ccea98686 (patch)
tree0affa31247ea572f6c865ce4300e6ccf46db72d7 /setup-named-chroot.sh
parent0e5b5af688d2465b917012d264340be7f5b8f5d6 (diff)
downloadbind-773ac2b8b36f1011207d5de13b5c5b1ccea98686.tar.gz
bind-773ac2b8b36f1011207d5de13b5c5b1ccea98686.tar.xz
bind-773ac2b8b36f1011207d5de13b5c5b1ccea98686.zip
initscript: don't umount /var/named when didn't mount it
Signed-off-by: Adam Tkac <atkac@redhat.com>
Diffstat (limited to 'setup-named-chroot.sh')
-rwxr-xr-xsetup-named-chroot.sh20
1 files changed, 11 insertions, 9 deletions
diff --git a/setup-named-chroot.sh b/setup-named-chroot.sh
index 38cb1ce..20dfd35 100755
--- a/setup-named-chroot.sh
+++ b/setup-named-chroot.sh
@@ -53,15 +53,17 @@ mount_chroot_conf()
umount_chroot_conf()
{
- for all in $ROOTDIR_MOUNT; do
- # Check if file is mount target. Do not use /proc/mounts because detecting
- # of modified mounted files can fail.
- if mount | grep -q '.* on '"$ROOTDIR$all"' .*'; then
- umount "$ROOTDIR$all"
- # Remove temporary created files
- [ -f "$all" ] && rm -f "$ROOTDIR$all"
- fi
- done
+ if [ -n "$ROOTDIR" ]; then
+ for all in $ROOTDIR_MOUNT; do
+ # Check if file is mount target. Do not use /proc/mounts because detecting
+ # of modified mounted files can fail.
+ if mount | grep -q '.* on '"$ROOTDIR$all"' .*'; then
+ umount "$ROOTDIR$all"
+ # Remove temporary created files
+ [ -f "$all" ] && rm -f "$ROOTDIR$all"
+ fi
+ done
+ fi
}
case "$2" in