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
|
||||
|
||||
* fallback if findmnt is absent
|
||||
|
||||
### Changed
|
||||
|
||||
### Deprecated
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue