mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	Fix escape to detect fs rw or ro
This commit is contained in:
		
							parent
							
								
									fff32acf1d
								
							
						
					
					
						commit
						a1587d86ea
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -914,15 +914,15 @@ function interfaces_status()
 | 
			
		|||
	mArray.openmptcprouter["loadavg"] = sys.exec("cat /proc/loadavg 2>/dev/null"):match("[%d%.]+ [%d%.]+ [%d%.]+")
 | 
			
		||||
	mArray.openmptcprouter["uptime"] = sys.exec("cat /proc/uptime 2>/dev/null"):match("[%d%.]+")
 | 
			
		||||
 | 
			
		||||
	mArray.openmptcprouter["fstype"] = sys.exec("cat /proc/mounts | awk '/\/dev\/root/ {print $3}' | tr -d '\n'")
 | 
			
		||||
	mArray.openmptcprouter["fstype"] = sys.exec("cat /proc/mounts 2>/dev/null | awk '/\\/dev\\/root/ {print $3}' | tr -d '\n'")
 | 
			
		||||
	if mArray.openmptcprouter["fstype"] == "ext4" then
 | 
			
		||||
		if sys.exec("cat /proc/mounts | awk '/\/dev\/root/ {print $4}' | grep ro") == "" then
 | 
			
		||||
		if sys.exec("cat /proc/mounts 2>/dev/null | awk '/\\/dev\\/root/ {print $4}' | grep ro") == "" then
 | 
			
		||||
			mArray.openmptcprouter["fsro"] = false
 | 
			
		||||
		else
 | 
			
		||||
			mArray.openmptcprouter["fsro"] = true
 | 
			
		||||
		end
 | 
			
		||||
	elseif mArray.openmptcprouter["fstype"] == "squashfs" then
 | 
			
		||||
		if sys.exec("cat /proc/mounts | awk '/overlayfs/ {print $4}' | grep overlay") == "" then
 | 
			
		||||
		if sys.exec("cat /proc/mounts 2>/dev/null | awk '/overlayfs/ {print $4}' | grep overlay") == "" then
 | 
			
		||||
			mArray.openmptcprouter["fsro"] = true
 | 
			
		||||
		else
 | 
			
		||||
			mArray.openmptcprouter["fsro"] = false
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue