fallback if findmnt is absent

This commit is contained in:
Jérémy Lecour 2021-06-17 10:54:08 +02:00 committed by Jérémy Lecour
parent 026fb9f5cd
commit 46b8015d93
2 changed files with 5 additions and 1 deletions

View File

@ -5,6 +5,8 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
### Added
* fallback if findmnt is absent
### Changed
### Deprecated

View File

@ -178,9 +178,11 @@ is_repository_readonly() {
if [ "$(get_system)" = "OpenBSD" ]; then
partition=$(stat -f '%Sd' $1)
mount | grep ${partition} | grep -q "read-only"
else
elif command -v findmnt >/dev/null; then
mountpoint=$(stat -c '%m' $1)
findmnt ${mountpoint} --noheadings --output OPTIONS -O ro
else
grep /usr /proc/mounts | grep -E '\bro\b'
fi
}
remount_repository_readwrite() {