Verified Commit 6bba6840 authored by Martin Prudek's avatar Martin Prudek
Browse files

mbim: Formatting

parent 8ca37722
......@@ -76,13 +76,13 @@ _proto_mbim_setup() {
[ -n "$delay" ] && sleep "$delay"
echo "mbim[$$]" "Reading capabilities"
umbim $DBG -n -d $device caps || {
echo "mbim[$$]" "Failed to read modem caps"
proto_notify_error "$interface" PIN_FAILED
return 1
}
tid=$((tid + 1))
echo "mbim[$$]" "Reading capabilities"
umbim $DBG -n -d $device caps || {
echo "mbim[$$]" "Failed to read modem caps"
proto_notify_error "$interface" PIN_FAILED
return 1
}
tid=$((tid + 1))
echo "mbim[$$]" "Checking subscriber"
umbim $DBG -n -t $tid -d $device subscriber || {
......@@ -114,22 +114,22 @@ _proto_mbim_setup() {
sleep 1;
done
tid=$((tid + 1))
echo "mbim[$$]" "Get IP config"
CONFIG=$(umbim $DBG -n -t $tid -d $device config) || {
echo "mbim[$$]" "config failed"
return 1
}
tid=$((tid + 1))
echo "$CONFIG" > /tmp/ip
IP=$(cat /tmp/ip |grep ipv4address |grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")
NM=$(cat /tmp/ip |grep ipv4address |grep -o '.\{2\}$')
GW=$(cat /tmp/ip |grep ipv4gateway |grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")
DNS=$(cat /tmp/ip |grep ipv4dnsserver |grep -E -o "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" |head -1)
cdr2mask $NM
echo "IP: $IP"
echo "MASK: $mask"
echo "GW: $GW"
......@@ -144,18 +144,18 @@ _proto_mbim_setup() {
json_add_string name "${interface}_4"
json_add_string ifname "@$interface"
json_add_string proto "static"
ifconfig wwan0 $IP netmask $mask
ip route add default dev wwan0
# ifup wwan0
echo "nameserver $DNS" >> /tmp/resolv.conf.auto
echo "nameserver $DNS" >> /etc/resolv.conf
# echo "$mask"
/bin/sh /home/loopback.sh
echo "Loopback created for IP: $IP"
/etc/init.d/sessionhold.sh start
echo "LTE-Watchdog started"
return 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment