diff --git a/evomaintenance.sh b/evomaintenance.sh index a459394..72b2d00 100755 --- a/evomaintenance.sh +++ b/evomaintenance.sh @@ -169,16 +169,31 @@ print_session_data() { } is_repository_readonly() { - mountpoint=$(stat -c '%m' $1) - findmnt ${mountpoint} --noheadings --output OPTIONS | grep -q -E "\bro\b" + if [ "$(get_system)" = "OpenBSD" ]; then + partition=$(stat -f '%Sd' $1) + mount | grep ${partition} | grep -q "read-only" + else + mountpoint=$(stat -c '%m' $1) + findmnt ${mountpoint} --noheadings --output OPTIONS | grep -q -E "\bro\b" + fi } remount_repository_readwrite() { - mountpoint=$(stat -c '%m' $1) - mount -o remount,rw ${mountpoint} + if [ "$(get_system)" = "OpenBSD" ]; then + partition=$(stat -f '%Sd' $1) + mount -u -w /dev/${partition} 2>/dev/null + else + mountpoint=$(stat -c '%m' $1) + mount -o remount,rw ${mountpoint} + fi } remount_repository_readonly() { - mountpoint=$(stat -c '%m' $1) - mount -o remount,ro ${mountpoint} 2>/dev/null + if [ "$(get_system)" = "OpenBSD" ]; then + partition=$(stat -f '%Sd' $1) + mount -u -r /dev/${partition} 2>/dev/null + else + mountpoint=$(stat -c '%m' $1) + mount -o remount,ro ${mountpoint} 2>/dev/null + fi } hook_commit() {