One Hat Cyber Team
Your IP :
18.117.229.168
Server IP :
104.21.96.1
Server :
Linux agrigation-prod 5.15.0-67-generic #74-Ubuntu SMP Wed Feb 22 14:14:39 UTC 2023 x86_64
Server Software :
nginx/1.24.0
PHP Version :
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
ubuntu-advantage
/
View File Name :
apt_news.py
#!/usr/bin/python3 import logging from datetime import datetime, timedelta, timezone from uaclient import apt from uaclient.apt_news import update_apt_news from uaclient.config import UAConfig from uaclient.daemon import setup_logging def main(cfg: UAConfig): if not cfg.apt_news: return last_update = apt.get_apt_cache_datetime() one_day_ago = datetime.now(timezone.utc) - timedelta(days=1) if last_update is not None and last_update > one_day_ago: return update_apt_news(cfg) if __name__ == "__main__": cfg = UAConfig(root_mode=True) setup_logging( logging.INFO, logging.DEBUG, log_file=cfg.log_file, logger=logging.getLogger(), ) main(cfg)