ungleich-tools/openwrt/openwrt-add-qmi-lte.sh

57 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/sh
# Based on work of Samuel Hailu, 2020-09-10
if [ $# -ne 1 ]; then
echo "$0 ip-address interface"
echo " ip-address: where to find the OpenWRT device"
exit 1
fi
my_ip=$1; shift
cat <<EOF | ssh -t "root@${my_ip}"
set -x
# update the sources & allow https handling
opkg update
opkg install libustream-openssl ca-bundle ca-certificates
# Install needed kernel module
opkg install kmod-usb-net-qmi-wwan uqmi luci-proto-qmi
2020-12-29 10:39:26 +00:00
2020-12-11 22:11:06 +00:00
# opkg install usb-modeswitch kmod-mii kmod-usb-net
# Create interface
2020-12-29 10:39:26 +00:00
# uci set network.lte=interface
# uci set network.LTE.ifname='${interface}'
2020-12-29 10:39:26 +00:00
# uci set network.lte.proto='qmi'
# add to correct firewall zone
# current_networks=\$(uci get firewall.@zone[1].network)
# if ! echo \$current_networks | grep -q LTE; then
# uci set firewall.@zone[1].network='\${current_networks} LTE'
# fi
# commit
uci commit
# reboot
reboot
EOF
2020-12-29 10:39:26 +00:00
exit 0
config interface 'lte'
option proto 'qmi'
option device '/dev/cdc-wdm0'
option apn 'internet'
option auth 'both'
option modes 'lte'
option pdptype 'ipv4'
option username 'any'
option password 'any'