mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	Fix modem device
This commit is contained in:
		
							parent
							
								
									7e183cfc07
								
							
						
					
					
						commit
						ec6cdb8209
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -20,7 +20,7 @@ omr_intf_set() {
 | 
			
		|||
	local ifname
 | 
			
		||||
	config_get ifname "$1" device
 | 
			
		||||
	[ -z "$ifname" ] && config_get ifname "$1" ifname
 | 
			
		||||
	config_get device "$1" device
 | 
			
		||||
	config_get devicename "$1" _modem_device
 | 
			
		||||
	config_get type "$1" type
 | 
			
		||||
 | 
			
		||||
	[ -z "$ifname" ] && ifname=$(ifstatus "$1" | jsonfilter -q -e '@["l3_device"]')
 | 
			
		||||
| 
						 | 
				
			
			@ -39,7 +39,7 @@ omr_intf_set() {
 | 
			
		|||
			uci -q delete network.$1.modalias
 | 
			
		||||
			uci -q delete network.$1.product
 | 
			
		||||
		fi
 | 
			
		||||
	elif [ "$type" != "macvlan" ] &&  [ -n "$device" ] && [ -f /sys/bus/usb-serial/devices/${devicename}/device/uevent ] && [ "$(cat /sys/class/net/${ifname}/device/uevent | grep PRODUCT)" != "" ]; then
 | 
			
		||||
	elif [ "$type" != "macvlan" ] &&  [ -n "$devicename" ] && [ -f /sys/bus/usb-serial/devices/${devicename}/device/uevent ] && [ "$(cat /sys/class/net/${ifname}/device/uevent | grep PRODUCT)" != "" ]; then
 | 
			
		||||
		mac=""
 | 
			
		||||
		if [ -f /sys/class/net/${ifname}/address ]; then
 | 
			
		||||
			mac="$(cat /sys/class/net/${ifname}/address | tr -d '\n')"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue