Add 4G Mobile support

pull/40/head
glen 4 years ago
parent 7abcf67657
commit 0fd809cb6f

@ -0,0 +1,16 @@
!/bin/sh
# 4G
sudo qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode='online' # power on module
# configure raw-ip protocol
ip link set wwan0 down
echo 'Y' | sudo tee /sys/class/net/wwan0/qmi/raw_ip
sudo ip link set wwan0 up
# connect to carrier
sudo qmicli -p -d /dev/cdc-wdm0 --wds-start-network="apn='sp.koodo.com',ip-type$
# set default rout and IP
sudo udhcpc -i wwan0
# receive DHCP lease from network
ip a s wwan0
exit 0

@ -256,19 +256,21 @@ function default_configuration() {
sudo mv $webroot_dir/config/loki-whois /usr/local/bin/loki-whois || install_error "unable to move loki-whois binary"
sudo mv $webroot_dir/config/loki-whois.service /etc/systemd/system/loki-whois.service || install_error "unable to move loki-whois.service to system"
sudo systemctl enable --now loki-whois #start loki-whois as service
sudo rm /etc/resolv.conf
sudo ln -s /etc/resolvconf/run/resolv.conf /etc/resolv.conf
sudo resolvconf -u || install_error "Unable to update resolv.conf"
# LokiPAP Batch file relocation and permissions in user loki-network directory
# LokiPAP Batch files relocation and permissions in user loki-network directory
sudo mv $webroot_dir/config/lokilaunch.sh /var/lib/lokinet/ || install error "Unable to move lokilaunch.sh, install Lokinet first"
sudo mv $webroot_dir/config/mobile.sh /var/lib/lokinet/ || install error "Unable to move mobile.sh, file not found"
#changes persmission on lokilaunch.sh
#changes persmission on lokilaunch.sh and mobile.sh
sudo chmod 755 /var/lib/lokinet/lokilaunch.sh
sudo chmod 755 /var/lib/lokinet/mobile.sh
# Generate required lines for Rasp AP to place into rc.local file.
# #RASPAP is for removal
@ -280,6 +282,10 @@ function default_configuration() {
#'fi'
"$tablerouteA"
"$tablerouteB"
"if ! [cat /sys/class/net/eth0/carrier] ; then"
"# Attempt 4G"
"/var/lib/lokinet/mobile.sh"
"fi"
#'sudo \/var\/lib\/lokinet\/.\/lokilaunch.sh start #RASPAP'
)

@ -14,7 +14,7 @@ function install_dependencies() {
curl -s https://deb.imaginary.stream/public.gpg | sudo apt-key add -
echo "deb https://deb.imaginary.stream $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/imaginary.stream.list
sudo apt-get update
sudo yes | apt-get install whois lighttpd $php_package git resolvconf hostapd dnsmasq vnstat lokinet || install_error "Unable to install dependencies"
sudo yes | apt-get install whois lighttpd $php_package git resolvconf hostapd dnsmasq vnstat libqmi-utils udhcpc lokinet || install_error "Unable to install dependencies"
}
#Remove NetworkManager and install dhcpd if required Armbian.

Loading…
Cancel
Save