mirror of
https://github.com/TheCommsChannel/TC2-APRS-BBS.git
synced 2025-06-27 15:27:16 -04:00
Add files via upload
This commit is contained in:
commit
635e7f42d2
9 changed files with 2399 additions and 0 deletions
41
main.py
Normal file
41
main.py
Normal file
|
@ -0,0 +1,41 @@
|
|||
import database
|
||||
import aprs_comm
|
||||
import threading
|
||||
import time
|
||||
|
||||
|
||||
def scheduled_cleanup():
|
||||
"""Periodically run cleanup of expired bulletins."""
|
||||
while True:
|
||||
try:
|
||||
print("Running periodic cleanup of expired bulletins...")
|
||||
database.delete_expired_bulletins()
|
||||
except Exception as e:
|
||||
print(f"Error during cleanup: {e}")
|
||||
time.sleep(24 * 60 * 60) # Run cleanup every 24 hours
|
||||
|
||||
def main():
|
||||
banner = """
|
||||
\033[96m
|
||||
████████╗ ██████╗██████╗ ██████╗ ██████╗ ███████╗
|
||||
╚══██╔══╝██╔════╝╚════██╗ ██╔══██╗██╔══██╗██╔════╝
|
||||
██║ ██║ █████╔╝█████╗██████╔╝██████╔╝███████╗
|
||||
██║ ██║ ██╔═══╝ ╚════╝██╔══██╗██╔══██╗╚════██║
|
||||
██║ ╚██████╗███████╗ ██████╔╝██████╔╝███████║
|
||||
╚═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝
|
||||
\033[93mAPRS Version\033[0m
|
||||
"""
|
||||
print(banner)
|
||||
|
||||
print("Initializing database...")
|
||||
database.init_db()
|
||||
|
||||
# Start periodic bulletin cleanup in a separate thread
|
||||
cleanup_thread = threading.Thread(target=scheduled_cleanup, daemon=True)
|
||||
cleanup_thread.start()
|
||||
|
||||
print("Starting APRS communications...")
|
||||
aprs_comm.start()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue