mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-30 18:07:52 +00:00 
			
		
		
		
	ucentral-client: fix init script file handling
Add file existence checks before reading gateway.json and initialise variables to prevent boot log spam when configuration file doesn't exist. Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
		| @@ -42,8 +42,10 @@ start_service() { | |||||||
| 		[ "${selfsigned}" == "true" ] && insecure=1 | 		[ "${selfsigned}" == "true" ] && insecure=1 | ||||||
| 	fi | 	fi | ||||||
|  |  | ||||||
| 	server=$(cat /etc/ucentral/gateway.json | jsonfilter -e '@["server"]') | 	server= | ||||||
| 	port=$(cat /etc/ucentral/gateway.json | jsonfilter -e '@["port"]') | 	[ -f /etc/ucentral/gateway.json ] && server=$(cat /etc/ucentral/gateway.json | jsonfilter -e '@["server"]') | ||||||
|  | 	port= | ||||||
|  | 	[ -f /etc/ucentral/gateway.json ] && port=$(cat /etc/ucentral/gateway.json | jsonfilter -e '@["port"]') | ||||||
| 	[ -n "$server" -a -n "$port" ] || return 0 | 	[ -n "$server" -a -n "$port" ] || return 0 | ||||||
|  |  | ||||||
| 	boot_cause=$(cat /tmp/pstore | jsonfilter -e '@["pstore"][-1]'.boot_cause) | 	boot_cause=$(cat /tmp/pstore | jsonfilter -e '@["pstore"][-1]'.boot_cause) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 John Crispin
					John Crispin