BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mangoh-drivers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
mangoh-drivers
Commits
3f9a4de3
Commit
3f9a4de3
authored
Sep 07, 2017
by
David Clark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test script which copies what web app does
parent
970179ce
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
mt7697ap.sh
linux_kernel_modules/mt7697wifi/scripts/mt7697ap.sh
+79
-0
No files found.
linux_kernel_modules/mt7697wifi/scripts/mt7697ap.sh
0 → 100644
View file @
3f9a4de3
#!/bin/sh
# Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
#
# PATH
export
PATH
=
/legato/systems/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
# Interfaces configuration
export
ITF_LAN
=
"wlan1"
# WiFi? access point interface
export
ITF_WAN
=
"rmnet0"
# 3G/4G interface as WLAN interface
export
WIFIAPIP
=
"192.168.20.1"
export
WIFIAPMASK
=
"255.255.255.0"
export
SUBNET
=
"192.168.0.0/24"
export
WIFIAPSTART
=
"192.168.20.10"
export
WIFIAPSTOP
=
"192.168.20.100"
# DHCP config file
export
DHCP_CFG_FILE
=
dnsmasq.wlan.conf
/sbin/ifup wlan1
echo
"Mounting of
$ITF_LAN
..."
ifconfig
$ITF_LAN
$WIFIAPIP
netmask
$WIFIAPMASK
up
echo
"Mounting the relay interface
$ITF_WAN
..."
case
"
$ITF_WAN
"
in
eth
*
)
ifconfig
$ITF_WAN
up
;;
rmnet
*
|
ppp
*
)
echo
"Enabling the radio on
$ITF_WAN
..."
cm radio on
sleep
1
echo
"Enabling the data connection on
$ITF_WAN
..."
cm data apn sp.telus.com
cm data connect &
sleep
1
echo
"Waiting for data connection on
$ITF_WAN
..."
;;
esac
RETRY
=
0
while
[
$RETRY
-lt
30
]
;
do
ITF_WAN_ADDR
=
$(
ifconfig
$ITF_WAN
|
grep
"inet addr"
|
cut
-d
':'
-f
2 |
cut
-d
' '
-f
1
)
if
[
"
$ITF_WAN_ADDR
"
==
""
]
;
then
sleep
1
RETRY
=
$((
$RETRY
+
1
))
else
break
fi
done
if
[
"
$ITF_WAN_ADDR
"
==
""
]
;
then
echo
"Mounting of relay interface
$ITF_WAN
failed..."
else
echo
"Relay interface
$ITF_WAN
IP address is
$ITF_WAN_ADDR
"
route add default gw
$ITF_WAN_ADDR
$ITF_WAN
fi
echo
"Enabling IP forwarding..."
echo
1
>
/proc/sys/net/ipv4/ip_forward
echo
"Configuring the NAT..."
modprobe ipt_MASQUERADE
iptables
-A
POSTROUTING
-t
nat
-o
$ITF_WAN
-j
MASQUERADE
iptables
-A
FORWARD
--match
state
--state
RELATED,ESTABLISHED
--jump
ACCEPT
iptables
-A
FORWARD
-i
$ITF_LAN
--destination
$SUBNET
--match
state
--state
NEW
--jump
ACCEPT
iptables
-A
INPUT
-s
$SUBNET
--jump
ACCEPT
echo
"Reconfiguring the DHCP server..."
/etc/init.d/dnsmasq stop
||
echo
-ne
">>>>>>>>>>>>>>>>>>> UNABLE TO STOP THE DHCP server"
### Configure the IP addresses range for DHCP (dnsmasq)
test
-L
/etc/dnsmasq.d/
$DHCP_CFG_FILE
||
ln
-s
/tmp/
$DHCP_CFG_FILE
/etc/dnsmasq.d/
$DHCP_CFG_FILE
echo
"Generating the configuration file for the DHCP server..."
echo
-ne
"log-dhcp
\n
log-queries
\n
log-facility=/tmp/dnsmasq.log
\n
dhcp-range=
$ITF_LAN
,
$WIFIAPSTART
,
$WIFIAPSTOP
,24h
\n
server=8.8.8.8
\n
"
>>
/tmp/
$DHCP_CFG_FILE
### Start the DHCP server
echo
"Restarting the DHCP server..."
/etc/init.d/dnsmasq start
||
echo
">>>>>>>>>>>>>>>>>>> UNABLE TO START THE DHCP server"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment