mqtt-aprs.py
def cleanup(signum, frame):
    """
    Signal handler to ensure we disconnect cleanly
    in the event of a SIGTERM or SIGINT.
    """
    logging.info("Disconnecting from broker")
    # Publish a retained message to state that this client is offline
    mqttc.publish(PRESENCETOPIC, "0", retain=True)
    mqttc.disconnect()
    logging.info("Exiting on signal %d", signum)
    sys.exit(signum)

    Signal handler to ensure we disconnect cleanly
    in the event of a SIGTERM or SIGINT.
    
Signal handler to ensure we disconnect cleanly
in the event of a SIGTERM or SIGINT.
Signal handler to ensure we disconnect cleanly in the event of a SIGTERM or SIGINT .
def cleanup(signum, frame):
    logging.info("Disconnecting from broker")
    mqttc.publish(PRESENCETOPIC, "0", retain=True)
    mqttc.disconnect()
    logging.info("Exiting on signal %d", signum)
    sys.exit(signum)
def cleanup ( signum , frame ) : logging . info ( "Disconnecting from broker" ) mqttc . publish ( PRESENCETOPIC , "0" , retain = True ) mqttc . disconnect ( ) logging . info ( "Exiting on signal %d" , signum ) sys . exit ( signum )
Signal handler to ensure we disconnect cleanly
in the event of a SIGTERM or SIGINT.
Signal handler to ensure we disconnect cleanly in the event of a SIGTERM or SIGINT .
"""
    Signal handler to ensure we disconnect cleanly
    in the event of a SIGTERM or SIGINT.
    """ # Publish a retained message to state that this client is offline
signum
frame