ssh: Cleanup permanent ssh patch
							parent
							
								
									c868bb410c
								
							
						
					
					
						commit
						f428bc449e
					
				@ -1,9 +1,16 @@
 | 
				
			|||||||
#!/bin/sh
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
grep -v "/ssh_patch.sh" /etc/crontabs/root > /etc/crontabs/root.new
 | 
					DIR_PATCH=/etc/crontabs/patches
 | 
				
			||||||
mv /etc/crontabs/root.new /etc/crontabs/root
 | 
					 | 
				
			||||||
/etc/init.d/cron restart
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
rm -f /etc/crontabs/patches/ssh_patch.sh
 | 
					if grep -q '/ssh_patch.sh' /etc/crontabs/root ; then
 | 
				
			||||||
 | 
						# remove older version of patch
 | 
				
			||||||
 | 
						grep -v "/ssh_patch.sh" /etc/crontabs/root > /etc/crontabs/root.new
 | 
				
			||||||
 | 
						mv /etc/crontabs/root.new /etc/crontabs/root
 | 
				
			||||||
 | 
						/etc/init.d/cron restart
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					uci delete firewall.auto_ssh_patch
 | 
				
			||||||
 | 
					uci commit firewall
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rm -f $DIR_PATCH/ssh_patch.sh
 | 
				
			||||||
rm -f /tmp/ssh_patch.log
 | 
					rm -f /tmp/ssh_patch.log
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
					Loading…
					
					
				
		Reference in New Issue