Skip to content

Commit

Permalink
clean the script exit status (#151)
Browse files Browse the repository at this point in the history
if the `grep` command doesn't find the boot partition mounted in
/proc/mounts, it skips the `umount` command (as expected) but it leaves
the script result code as 'failed' (undesired side-effect)

just running a successful command solves this issue. ('exit 0' also
works)

fixes #149
  • Loading branch information
alexsander-souza authored Oct 17, 2023
1 parent 5a4b7ce commit 44a392a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vmware-esxi/post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ echo 'Unmounting image...'
sync -f "$TMP_DIR"/boot
fusermount -z -u "$TMP_DIR"/boot
grep -qs "$TMP_DIR/boot " /proc/mounts && umount -f "$TMP_DIR"/boot

echo 'Done'

0 comments on commit 44a392a

Please sign in to comment.