fallback if findmnt is absent
This commit is contained in:
parent
026fb9f5cd
commit
46b8015d93
|
@ -5,6 +5,8 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
* fallback if findmnt is absent
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
|
@ -178,9 +178,11 @@ is_repository_readonly() {
|
||||||
if [ "$(get_system)" = "OpenBSD" ]; then
|
if [ "$(get_system)" = "OpenBSD" ]; then
|
||||||
partition=$(stat -f '%Sd' $1)
|
partition=$(stat -f '%Sd' $1)
|
||||||
mount | grep ${partition} | grep -q "read-only"
|
mount | grep ${partition} | grep -q "read-only"
|
||||||
else
|
elif command -v findmnt >/dev/null; then
|
||||||
mountpoint=$(stat -c '%m' $1)
|
mountpoint=$(stat -c '%m' $1)
|
||||||
findmnt ${mountpoint} --noheadings --output OPTIONS -O ro
|
findmnt ${mountpoint} --noheadings --output OPTIONS -O ro
|
||||||
|
else
|
||||||
|
grep /usr /proc/mounts | grep -E '\bro\b'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
remount_repository_readwrite() {
|
remount_repository_readwrite() {
|
||||||
|
|
Loading…
Reference in a new issue