On Fri, 20 Sep 2024, Florent Rougon wrote:
Le 20/09/2024, Tim Woodall <debianu...@woodall.me.uk> a ?crit:
Haven't looked at the script but assuming it's run set -e, then your
suggestion will fail if it's already mounted.
Why?
Because the script will abort after the mount fails.
root@dirac:~# cat test.sh
#!/bin/bash
set -e
mount /boot/efi2
echo "do important stuff"
root@dirac:~# ./test.sh
mount: /boot/efi2: /dev/sda2 already mounted on /boot/efi2.
dmesg(1) may have more information after failed mount system call.
Note that do important stuff is never reached.