@ -6,16 +6,6 @@ import traceback
if platform . system ( ) == " Windows " :
if platform . system ( ) == " Windows " :
from colorama import init
from colorama import init
init ( convert = True )
init ( convert = True )
elif platform . system ( ) == " Linux " :
pid_file_path = " /home/plane-notify/pid.pid "
def write_pid_file ( filepath ) :
import os
pid = str ( os . getpid ( ) )
f = open ( filepath , ' w ' )
f . write ( pid )
f . close ( )
write_pid_file ( pid_file_path )
print ( " Made PIDFile " )
from planeClass import Plane
from planeClass import Plane
from datetime import datetime
from datetime import datetime
import pytz
import pytz
@ -63,7 +53,6 @@ def service_exit(signum, frame):
if main_config . getboolean ( ' DISCORD ' , ' ENABLE ' ) :
if main_config . getboolean ( ' DISCORD ' , ' ENABLE ' ) :
from defDiscord import sendDis
from defDiscord import sendDis
sendDis ( " Service Stop " , main_config )
sendDis ( " Service Stop " , main_config )
os . remove ( pid_file_path )
raise SystemExit ( " Service Stop " )
raise SystemExit ( " Service Stop " )
signal . signal ( signal . SIGTERM , service_exit )
signal . signal ( signal . SIGTERM , service_exit )
if os . path . isfile ( " lookup_route.py " ) :
if os . path . isfile ( " lookup_route.py " ) :
@ -223,7 +212,4 @@ except Exception as e:
logging . error ( str ( traceback . format_exc ( ) ) )
logging . error ( str ( traceback . format_exc ( ) ) )
from defDiscord import sendDis
from defDiscord import sendDis
sendDis ( str ( " Error Exiting: " + str ( e ) + " Failed on " + key ) , main_config , " crash_latest.log " )
sendDis ( str ( " Error Exiting: " + str ( e ) + " Failed on " + key ) , main_config , " crash_latest.log " )
raise e
raise e
finally :
if platform . system ( ) == " Linux " :
os . remove ( pid_file_path )