mirror of
				https://github.com/Telecominfraproject/ols-ucentral-schema.git
				synced 2025-10-30 01:32:26 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			627 B
		
	
	
	
		
			Ucode
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			627 B
		
	
	
	
		
			Ucode
		
	
	
	
	
	
| let tar = b64dec(args.certificates);
 | |
| 
 | |
| if (!tar || !fs.writefile('/tmp/certs.tar', tar)) {
 | |
| 	result_json({
 | |
| 		"error": 2,
 | |
| 		"text": 'failed to extract certificates'
 | |
| 	});
 | |
| 	return;
 | |
| }
 | |
| 
 | |
| if (system('/sbin/certupdate')) {
 | |
| 	result_json({
 | |
| 		"error": 2,
 | |
| 		"text": 'failed to update certificates'
 | |
| 	});
 | |
| 	return;
 | |
| }
 | |
| 
 | |
| include('reboot_cause.uc', { reason: 'certupdate' });
 | |
| 
 | |
| ctx.call("ucentral", "result", {
 | |
|                 "status": {
 | |
|                         "error": 0,
 | |
|                         "text": 'Success'
 | |
|                 }, "id": +id
 | |
|         });
 | |
| sleep(5000);
 | |
| system("(sleep 10; jffs2reset -y -r)&");
 | |
| system("/etc/init.d/ucentral stop");
 | 
