シェルスクリプト例 (/etc/rc)

#! /sbin/sh
cd /
MESSAGE='\07/usr failed to mount; may be unable to reach multiuser state'
case $1 in
'start')
        if test -z "`grep -v '^\#' /etc/fstab | sed 's/#.*//' | grep '[         ]/usr[/]*[      ]' `"; then
                exit 0
        fi
        if test -n "`/sbin/ls /etc/rc2.d | sed '/S04usr/,/S12filesystems/!d' | \
                                          sed -e '/S04usr/d' -e '/S12filesystems/d'`"
        then
                if /sbin/chkconfig verbose
                then
                        echo "Mounting /usr:"
                fi
                if /sbin/mount -c /usr > /etc/fscklogs/rusr 2>&1
                then
                        cat /etc/fscklogs/rusr
                else
                        cat /etc/fscklogs/rusr
                        echo $MESSAGE
                        sleep 5
                fi
        fi
        ;;
'stop')
        ;;
*)
        echo "usage: /etc/init.d/usr {start|stop}"
        ;;
esac