mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-21 15:10:22 +00:00
Correct Hilink authentication and service
This commit is contained in:
parent
0625fcc5ef
commit
8f702a2a55
2 changed files with 8 additions and 3 deletions
|
@ -1,3 +1,3 @@
|
||||||
SUBSYSTEM=="net", ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14db", NAME="hilink%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="start start_huawei_hilink.service"
|
SUBSYSTEM=="net", ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14db", NAME="hilink%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="start start_huawei_hilink@hilink%n.service"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,14 +33,19 @@ while [ -n "$1" ]; do
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ ! _loginState ] && [ -z "$hilink_password" ] || [ -z "$hilink_pin" ]; then _getAuthRouter; fi
|
|
||||||
|
|
||||||
if [ ! -z "$devname" ]; then # get host IP for given device name
|
if [ ! -z "$devname" ]; then # get host IP for given device name
|
||||||
gw=$(ip route list | sed -rn "s/default via (([0-9]{1,3}\.){3}[0-9]{1,3}).*dev $devname.*/\1/p")
|
gw=$(ip route list | sed -rn "s/default via (([0-9]{1,3}\.){3}[0-9]{1,3}).*dev $devname.*/\1/p")
|
||||||
if [ -z "$gw" ]; then exit; fi # device name not found in routing list -> abort
|
if [ -z "$gw" ]; then exit; fi # device name not found in routing list -> abort
|
||||||
hilink_host="$gw"
|
hilink_host="$gw"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$hilink_password" ] || [ -z "$hilink_pin" ]; then
|
||||||
|
_getAuthRouter
|
||||||
|
if [ ! -z "$raspap_user" ]; then hilink_user="$raspap_user"; fi
|
||||||
|
if [ ! -z "$raspap_password" ]; then hilink_password="$raspap_password"; fi
|
||||||
|
if [ ! -z "$raspap_pin" ]; then hilink_pin="$raspap_pin"; fi
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Hilink: switch device at $hilink_host to mode $datamode" | systemd-cat
|
echo "Hilink: switch device at $hilink_host to mode $datamode" | systemd-cat
|
||||||
|
|
||||||
status="usage: -c 1/0 to disconnect/connect"
|
status="usage: -c 1/0 to disconnect/connect"
|
||||||
|
|
Loading…
Reference in a new issue