#!/bin/sh
#
# ptf : load of plateform modules : from /etc/rc.d/modules.LE|MR|HE|VHE
#

. /etc/init.d/rc.config

# do the required action
case "$1" in
    start|"")
        	# Start the modules
        	if [ -x /etc/init.d/rc.modules.file ]; then 
        		if [ -f /etc/modules.$PHONE_MODEL ]; then 
               			/etc/init.d/rc.modules.file /etc/modules.$PHONE_MODEL
            		else 
                		echoerror \"Cannot find the file containing modules \"; 
			fi
            	else 
                	echoerror \"Cannot start modules.file script\"; 
        	fi
    ;; 
    stop)  
        	# Stop the modules
        	if [ -x /etc/init.d/rc.modules.file ]; then 
        		if [ -f /etc/modules.$PHONE_MODEL ]; then 
               			/etc/init.d/rc.modules.file /etc/modules.$PHONE_MODEL unload /etc/modules.no-unload
            		else 
                		echoerror \"Cannot find the file containing modules \"; 
			fi
            	else 
                	echoerror \"Cannot start modules.file script\"; 
        	fi
    ;;

    # crms00225116 BEGIN
    status)
    	if [ -f "$USB_FLAG" ]; then
    		printf "started\n"
    	else
    		printf "stopped\n"
    	fi
    	;;
    # crms00225116 END

    *)
        echo "Usage $scriptname {start|stop}" >&2
        exit 1
    ;;
esac
