54 lines
1.1 KiB
Python
54 lines
1.1 KiB
Python
# _ __________________
|
|
# | | / / _/ ____/ _/ /
|
|
# | | / // // / __ / // /
|
|
# | |/ // // /_/ // // /___
|
|
# |___/___/\____/___/_____/
|
|
# © Uthmn 2025 under MIT license
|
|
|
|
import time
|
|
|
|
import services.apt
|
|
import services.mail
|
|
|
|
from dotenv import load_dotenv
|
|
from os import getenv
|
|
from os.path import dirname, join
|
|
|
|
import typer
|
|
|
|
# Load environment variables from .env file
|
|
dotenv_path = join(dirname(__file__), ".env")
|
|
load_dotenv(dotenv_path)
|
|
|
|
# TODO: Logging
|
|
# TODO: Email alerts + structure
|
|
# TODO: Use typer for CLI
|
|
# TODO: Fix readme and git.uthmn.com page for final release.
|
|
# TODO: Error handling all round
|
|
|
|
app = typer.Typer()
|
|
|
|
@app.command()
|
|
def main():
|
|
"""
|
|
Checks for updates and emails hourly for security, daily for general as a daemon.
|
|
"""
|
|
pass
|
|
|
|
@app.command()
|
|
def now():
|
|
"""
|
|
Checks for apt upgrades and emails them then exits.
|
|
"""
|
|
# TODO: Flag --now to run temporarily and just execute hourly tasks instantly then exit
|
|
pass
|
|
|
|
@app.callback()
|
|
def callback():
|
|
"""
|
|
Checks apt for upgrades and emails them
|
|
"""
|
|
|
|
if __name__ == "__main__":
|
|
app()
|