2020-09-11 11:23:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Based on work of Samuel Hailu, 2020-09-10
|
|
|
|
|
2020-11-30 09:34:53 +00:00
|
|
|
if [ $# -ne 1 ]; then
|
2020-09-11 11:23:14 +00:00
|
|
|
echo "$0 ip-address interface"
|
|
|
|
echo " ip-address: where to find the OpenWRT device"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
my_ip=$1; shift
|
|
|
|
interface=$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
|
2020-11-30 09:34:53 +00:00
|
|
|
opkg install kmod-usb-net-qmi-wwan uqmi luci-proto-qmi
|
|
|
|
|
|
|
|
# opkg install usb-modeswitch kmod-mii kmod-usb-net kmod-usb-wdm kmod-usb-net-qmi-wwan uqmi
|
2020-09-11 11:23:14 +00:00
|
|
|
|
|
|
|
# Create interface
|
2020-11-30 09:34:53 +00:00
|
|
|
# uci set network.LTE=interface
|
|
|
|
# uci set network.LTE.ifname='${interface}'
|
|
|
|
# uci set network.LTE.proto='dhcp'
|
2020-09-11 11:23:14 +00:00
|
|
|
|
|
|
|
# add to correct firewall zone
|
2020-11-30 09:34:53 +00:00
|
|
|
# current_networks=\$(uci get firewall.@zone[1].network)
|
2020-09-11 11:23:14 +00:00
|
|
|
|
2020-11-30 09:34:53 +00:00
|
|
|
# if ! echo \$current_networks | grep -q LTE; then
|
|
|
|
# uci set firewall.@zone[1].network='\${current_networks} LTE'
|
|
|
|
# fi
|
2020-09-11 11:23:14 +00:00
|
|
|
|
|
|
|
# commit
|
|
|
|
uci commit
|
|
|
|
|
|
|
|
# reboot
|
|
|
|
|
|
|
|
reboot
|
|
|
|
|
|
|
|
EOF
|