mountpoint does not exist

This commit is contained in:
Cameron Thompson
2024-07-11 20:38:33 -04:00
parent d764b70ec4
commit 4a8bff4138

View File

@@ -101,27 +101,24 @@ send_at_commands() {
}
basic_55x_setup() {
# Check the mount environment
df -h
# Check if /etc is mounted
if mountpoint -q /etc; then
if grep -qs '/etc ' /proc/mounts; then
echo "Unmounting /etc..."
umount -lf /etc
fi
# Check if /real_rootfs is mounted
if mountpoint -q /real_rootfs; then
if grep -qs '/real_rootfs ' /proc/mounts; then
# Echo message in red
echo -e "\033[31mThe environment has already been setup. If you want to undo the changes temporarily run service mount-fix stop.\033[0m"
exit 1
fi
# Check if neither /etc nor /real_rootfs exists
if ! mountpoint -q /etc && ! mountpoint -q /real_rootfs; then
# Check if neither /etc nor /real_rootfs is mounted
if ! grep -qs '/etc ' /proc/mounts && ! grep -qs '/real_rootfs ' /proc/mounts; then
# Echo message in red
echo -e "\033[31mSomething is wrong or this is not an SDXPINN modem.\033[0m"
echo -e "\033[31mI was expecting either /etc or /real_rootfs to be a mount point.\033[0m"
echo -e "\033[31mI was expecting either /etc or /real_rootfs to be a mount point.\033[0m"
exit 1
fi