mirror of
				https://github.com/billz/raspap-webgui.git
				synced 2025-03-01 10:31:47 +00:00 
			
		
		
		
	Correct Hilink authentication and service
This commit is contained in:
		| @@ -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 | ||||
| done | ||||
|  | ||||
| if [ ! _loginState ] && [ -z "$hilink_password" ] || [ -z "$hilink_pin" ]; then _getAuthRouter; fi | ||||
|  | ||||
| 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") | ||||
|     if [ -z "$gw" ]; then exit; fi  # device name not found in routing list -> abort  | ||||
|     hilink_host="$gw" | ||||
| 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 | ||||
|  | ||||
| status="usage: -c 1/0 to disconnect/connect" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user