Use do_on_exit() in build scripts for cleanup

This commit is contained in:
Reto Buerki
2013-01-17 15:22:11 +01:00
committed by Tobias Brunner
parent 9a045eef8e
commit 0cc4063799
3 changed files with 11 additions and 9 deletions
+4 -1
View File
@@ -36,6 +36,9 @@ else
HOSTS=$*
fi
# just to be sure
do_on_exit umount $LOOPDIR
for host in $HOSTS
do
log_action "Creating guest image for $host"
@@ -56,6 +59,6 @@ do
execute_chroot "chown -R openldap:openldap /var/lib/ldap" 0
fi
sync
umount $LOOPDIR
log_status 0
umount $LOOPDIR
done