diff --git a/CHANGELOG.md b/CHANGELOG.md index 632a30e..7371a85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/evomaintenance.sh b/evomaintenance.sh index 1cd4ce7..384501a 100755 --- a/evomaintenance.sh +++ b/evomaintenance.sh @@ -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() {