fix bug caused by stopping bot while not running
This commit is contained in:
		
							parent
							
								
									0f9f9aa885
								
							
						
					
					
						commit
						b5d8ef69f4
					
				
							
								
								
									
										5
									
								
								bot.sh
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								bot.sh
									
									
									
									
									
								
							@ -1,5 +1,8 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
[ "${1}" == "stop" ] && kill -SIGTERM "$(cat /tmp/tpdnsbot.pid)" 2>/dev/null && exit 0
 | 
			
		||||
[ "${1}" == "stop" ] && {
 | 
			
		||||
  kill -SIGTERM "$(cat /tmp/tpdnsbot.pid)" 2>/dev/null
 | 
			
		||||
  exit 0
 | 
			
		||||
}
 | 
			
		||||
printf "%s" "${$}" > /tmp/tpdnsbot.pid
 | 
			
		||||
 | 
			
		||||
api_url="https://api.telegram.org/bot${TELEGRAM_DNS_TOKEN}/"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user