feat: add feature to update cachyOS in the background
This commit is contained in:
26
bin/cachyos-updater
Executable file
26
bin/cachyos-updater
Executable file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Point d'entrée du daemon CachyOS Updater (doit tourner en root)."""
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
if os.geteuid() != 0:
|
||||
print("Erreur : ce daemon doit être lancé en tant que root.", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
sys.path.insert(0, "/usr/lib/cachyos-updater")
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s [%(levelname)s] %(message)s",
|
||||
stream=sys.stdout,
|
||||
)
|
||||
|
||||
from daemon import Daemon
|
||||
|
||||
try:
|
||||
asyncio.run(Daemon().run())
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
Reference in New Issue
Block a user