| 
				
			 | 
			
			
				@@ -414,10 +414,16 @@ function prosody_daemon_restart_script { 
			 | 
		
	
		
			
			| 
				414
			 | 
			
				414
			 | 
			
			
				     # On rare occasions the daemon appears to get stuck 
			 | 
		
	
		
			
			| 
				415
			 | 
			
				415
			 | 
			
			
				     # i.e. still active, but not accepting connections 
			 | 
		
	
		
			
			| 
				416
			 | 
			
				416
			 | 
			
			
				     # This ensures that it will unstick itself at least once per day 
			 | 
		
	
		
			
			| 
				417
			 | 
			
				
			 | 
			
			
				-    if [ ! -f /etc/cron.daily/prosody ]; then 
			 | 
		
	
		
			
			| 
				418
			 | 
			
				
			 | 
			
			
				-        echo '#!/bin/bash' > /etc/cron.daily/prosody 
			 | 
		
	
		
			
			| 
				419
			 | 
			
				
			 | 
			
			
				-        echo 'systemctl restart prosody' >> /etc/cron.daily/prosody 
			 | 
		
	
		
			
			| 
				420
			 | 
			
				
			 | 
			
			
				-        chmod +x /etc/cron.daily/prosody 
			 | 
		
	
		
			
			| 
				
			 | 
			
				417
			 | 
			
			
				+    if [ -f /etc/cron.daily/prosody ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				418
			 | 
			
			
				+        rm /etc/cron.daily/prosody 
			 | 
		
	
		
			
			| 
				
			 | 
			
				419
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				420
			 | 
			
			
				+    if [ ! -f /etc/cron.hourly/prosody ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				421
			 | 
			
			
				+        { '#!/bin/bash'; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				422
			 | 
			
			
				+          "is_active=\$(systemctl is-active prosody)"; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				423
			 | 
			
			
				+          "if [[ \"\$is_active\" != 'active' ]]; then"; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				424
			 | 
			
			
				+          '  systemctl restart prosody' 
			 | 
		
	
		
			
			| 
				
			 | 
			
				425
			 | 
			
			
				+          'fi'; } > /etc/cron.hourly/prosody 
			 | 
		
	
		
			
			| 
				
			 | 
			
				426
			 | 
			
			
				+        chmod +x /etc/cron.hourly/prosody 
			 | 
		
	
		
			
			| 
				421
			 | 
			
				427
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				422
			 | 
			
				428
			 | 
			
			
				 } 
			 | 
		
	
		
			
			| 
				423
			 | 
			
				429
			 | 
			
			
				  
			 |