#! /bin/sh
### BEGIN INIT INFO
# Provides:          umountroot
# Required-Start:    umountfs
# Required-Stop:     umountfs
# Default-Start:     6
# Default-Stop:
# Short-Description: Mount the root filesystem read-only.
### END INIT INFO
#
# v 0.1, localtime: 2005/07/06 19:00 CEST
#
# Written by Markus Nass <generalstone@gmx.net>
#

PATH=/sbin:/bin

[ -z "$VERBOSE" ] && VERBOSE=yes
[ -f /etc/default/rcS ] && . /etc/default/rcS
. /lib/lsb/init-functions

do_stop () {
    [ "$VERBOSE" != no ] && log_action_begin_msg "Mounting root filesystem read-only"
    mount -n -o remount,ro /
    [ "$VERBOSE" != no ] && log_action_end_msg $?
}

case "$1" in
    start)
        ;;
    restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
    stop)
        do_stop
        ;;
    *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac

: exit 0
