Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/etc/powerd/postresume.d/disable_mesh.sh
blob: fd62abfac5d3f751d7f40912ad65ad6c077c0a0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
# Copyright (C) 2010, Martin Abente
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

#WARNING: 
#         This is a workaround for disabling the mesh until the feature gets
#         included in the libertas code. Therefore this workaround MUST be
#         removed after that.

#INSTRUCTIONS:
#         1. Copy this file to /etc/powerd/postresume.d
#         2. Grant it execution permissions (chmod 755)

LBS_MESH=/sys/class/net/eth0/lbs_mesh
XO_MODEL=/ofw/mfg-data/MN

if [ $(cat $XO_MODEL) != "XO-1" ]
then
    exit 0
fi

if [ -f $LBS_MESH ] && [ $(cat $LBS_MESH) = "0x0" ]
then
    exit 0
fi

while [ ! -f $LBS_MESH ] || [ $(cat $LBS_MESH) = "0x0" ]
do
    sleep 0.5s
done

echo 0 > $LBS_MESH