mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-23 09:11:50 +02:00
Suppress smb permissions messages
https://github.com/alexbelgium/hassio-addons/issues/2449
This commit is contained in:
@@ -36,15 +36,16 @@ test_mount() {
|
|||||||
_test_write() {
|
_test_write() {
|
||||||
local testfile="$mountpoint/.writetest_$$"
|
local testfile="$mountpoint/.writetest_$$"
|
||||||
if : >"$testfile" 2>/dev/null; then
|
if : >"$testfile" 2>/dev/null; then
|
||||||
rm -f "$testfile" || true
|
rm -f "$testfile" 2>/dev/null || true
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
|
rm -f "$testfile" 2>/dev/null || true
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# First write test
|
# First write test
|
||||||
if _test_write; then
|
if _test_write 2>/dev/null; then
|
||||||
MOUNTED=true
|
MOUNTED=true
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@@ -56,7 +57,7 @@ test_mount() {
|
|||||||
|
|
||||||
umount "$mountpoint" 2>/dev/null || true
|
umount "$mountpoint" 2>/dev/null || true
|
||||||
if mount_drive "$MOUNTOPTIONS"; then
|
if mount_drive "$MOUNTOPTIONS"; then
|
||||||
if _test_write; then
|
if _test_write 2>/dev/null; then
|
||||||
MOUNTED=true
|
MOUNTED=true
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@@ -70,7 +71,7 @@ test_mount() {
|
|||||||
|
|
||||||
umount "$mountpoint" 2>/dev/null || true
|
umount "$mountpoint" 2>/dev/null || true
|
||||||
if mount_drive "$MOUNTOPTIONS"; then
|
if mount_drive "$MOUNTOPTIONS"; then
|
||||||
if _test_write; then
|
if _test_write 2>/dev/null; then
|
||||||
MOUNTED=true
|
MOUNTED=true
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@@ -78,7 +79,6 @@ test_mount() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# ---- Final: mounted but not writable ----
|
# ---- Final: mounted but not writable ----
|
||||||
bashio::log.warning "Disk mounted but is not writable (permission denied). Marking as read-only."
|
|
||||||
MOUNTED="readonly"
|
MOUNTED="readonly"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user