Skip to content

Commit

Permalink
add test if $dirs is empty, cleanup PID file of fai
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Lange committed Sep 13, 2016
1 parent e9b8414 commit 053ef62
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/fai-diskimage
Expand Up @@ -27,9 +27,16 @@ cleanup() {
for dir in $(mount | awk '{print $3}'| grep $mnt | sort -r); do
dirs+=" $dir"
done
umount $dirs
[ -n "$dirs" ] && umount $dirs
losetup -d $loop
rm -rf $mnt
if [ -f /var/run/fai/FAI_INSTALLATION_IN_PROGRESS ]; then
if pgrep -F /var/run/fai/FAI_INSTALLATION_IN_PROGRESS; then
:
else
rm /var/run/fai/FAI_INSTALLATION_IN_PROGRESS
fi
fi
}

usage() {
Expand Down

0 comments on commit 053ef62

Please sign in to comment.