Updated documentation for 0.2 release
[mtetherd] / mtetherd-usbnet-disable.sh
1 #!/bin/sh
2 # This file is part of mtetherd
3 #
4 # Copyright (c) 2010 Gregor Riepl <onitake@gmail.com>
5 #
6 # Based on osso-usb-mass-storage-disable.sh,
7 # Copyright (C) 2004-2009 Nokia Corporation. All rights reserved.
8 # Contact: Kimmo Hämäläinen <kimmo.hamalainen@nokia.com>
9 #
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License 
12 # version 2 as published by the Free Software Foundation. 
13 #
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 # General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22 # 02110-1301 USA
23
24 /sbin/lsmod | grep g_ether > /dev/null
25 if [ $? != 0 ]; then
26   # the module is not loaded
27   exit 0
28 fi
29
30 /sbin/rmmod g_ether
31 if [ $? != 0 ]; then
32     logger "$0: failed to unload g_ether"
33     exit 1
34 fi
35
36 # load this here or the system will not receive any USB events
37 /sbin/modprobe g_file_storage
38
39 exit 0
40