From 9baa37863653dd6a5d2b5cac2c928040390ddc18 Mon Sep 17 00:00:00 2001 From: glen Date: Thu, 3 Dec 2020 19:45:13 -0500 Subject: [PATCH] Add GUI APN setting functions --- config/mobile.sh | 2 +- includes/functions.php | 61 +++++++++++++++++++++++++++++++++++++----- installers/common.sh | 2 +- 3 files changed, 56 insertions(+), 9 deletions(-) diff --git a/config/mobile.sh b/config/mobile.sh index c554c34..92b9d32 100644 --- a/config/mobile.sh +++ b/config/mobile.sh @@ -7,7 +7,7 @@ sudo 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=4" --client-no-release-cid +sudo qmicli -p -d /dev/cdc-wdm0 --wds-start-network="apn='your.apn.here',ip-type=4" --client-no-release-cid # set default rout and IP sudo udhcpc -i wwan0 # receive DHCP lease from network diff --git a/includes/functions.php b/includes/functions.php index edeb0ee..ad7747b 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -54,6 +54,16 @@ function safefilerewrite($fileName, $dataToSave) } } +//Function to get string between used for Mobile.sh + +function get_string_between($string, $start, $end){ + $string = ' ' . $string; + $ini = strpos($string, $start); + if ($ini == 0) return ''; + $ini += strlen($start); + $len = strpos($string, $end, $ini) - $ini; + return substr($string, $ini, $len); +} /** @@ -234,7 +244,8 @@ function DisplayLokinetConfig()
  • Daemon Settings
  • - +
  • Mobile APN +
  • WHOIS
  • @@ -265,6 +276,17 @@ function DisplayLokinetConfig()
    +
    +
    +
    Enter mobile provider apn:
    + + +
    + ' , PHP_EOL; + ?>
    +
    +
    @@ -404,17 +426,42 @@ function ActivateLokinetConfig() echo "\n"; ?>
    $output"; - ?>' , PHP_EOL; - echo "\n"; - ?>
    ' , PHP_EOL; + echo "\n"; + ?>
    Reboot required to start mobile. Reboot now?"; + ?>' , PHP_EOL; + echo '' , PHP_EOL; + echo "\n"; + ?>