#!/bin/bash

# sourcing our current rc.conf requires this to be a bash script
. /usr/lib/rc/functions

case "$1" in
    start)
        stat_busy "Remounting root filesystem rw"
        mount -o remount,rw / || stat_die remount-root
        add_daemon remount-root
        stat_done remount-root
        ;;
    stop)
        stat_busy "Remounting root filesystem ro"
        mount -o remount,ro / || stat_die remount-root
        sync
        rm_daemon remount-root
        stat_done remount-root
        ;;
    *)
        echo "usage: $0 {start|stop}"
        exit 1
        ;;
esac
