mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-30 01:52:51 +00:00 
			
		
		
		
	 6ba26cba2b
			
		
	
	6ba26cba2b
	
	
	
		
			
			cloud_discovery will not start if the CN does not match the devices serial. an error will be written to syslog --- Wed Aug 6 14:23:23 2025 user.notice root: ERROR Wed Aug 6 14:23:23 2025 user.notice root: ERROR Wed Aug 6 14:23:23 2025 user.notice root: ERROR Wed Aug 6 14:23:23 2025 user.notice root: The certificate used has a CN that does not match the serial of the device Wed Aug 6 14:23:23 2025 user.notice root: ERROR Wed Aug 6 14:23:23 2025 user.notice root: ERROR Wed Aug 6 14:23:23 2025 user.notice root: ERROR --- Signed-off-by: John Crispin <john@phrozen.org>
		
			
				
	
	
		
			43 lines
		
	
	
		
			912 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			912 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/sh /etc/rc.common
 | |
| 
 | |
| START=98
 | |
| USE_PROCD=1
 | |
| PROG=/usr/bin/cloud_discovery
 | |
| 
 | |
| service_triggers() {
 | |
| 	procd_add_reload_trigger ucentral
 | |
| }
 | |
| 
 | |
| reload_service() {
 | |
| 	ubus call cloud reload
 | |
| }
 | |
| 
 | |
| start_service() {
 | |
| 	[ -f /etc/ucentral/capabilities.json ] || {
 | |
| 		mkdir -p /etc/ucentral/
 | |
| 		/usr/share/ucentral/capabilities.uc
 | |
| 	}
 | |
| 
 | |
| 	local valid=$(cat /etc/ucentral/gateway.json | jsonfilter -e '@["valid"]')
 | |
| 	[ "$valid" == "true" ] || 
 | |
| 		/usr/share/ucentral/ucentral.uc /etc/ucentral/ucentral.cfg.0000000001 > /dev/null
 | |
| 
 | |
| 	est_client check
 | |
| 	[ $? -eq 1 ] && {
 | |
| 		logger ERROR
 | |
| 		logger ERROR
 | |
| 		logger ERROR
 | |
| 		logger The certificate used has a CN that does not match the serial of the device
 | |
| 		echo The certificate used has a CN that does not match the serial of the device
 | |
| 		logger ERROR
 | |
| 		logger ERROR
 | |
| 		logger ERROR
 | |
| 		return
 | |
| 	}
 | |
| 
 | |
| 	procd_open_instance
 | |
| 	procd_set_param command "$PROG"
 | |
| 	procd_set_param respawn
 | |
| 	procd_close_instance
 | |
| }
 |