mirror of
https://github.com/unixtensor/proxmox-ntfy.git
synced 2025-06-27 23:58:06 +00:00
package.py
-> command.py
a
This commit is contained in:
@ -2,7 +2,7 @@ import subprocess
|
||||
|
||||
from typing import Optional
|
||||
|
||||
def installed(package_name: str) -> Optional[bool]:
|
||||
def package_installed(package_name: str) -> Optional[bool]:
|
||||
try:
|
||||
installed = subprocess.run(["dpkg", "-s", package_name], stdout=subprocess.PIPE, stderr=subprocess.PIPE).returncode == 0
|
||||
if not installed:
|
||||
@ -10,4 +10,5 @@ def installed(package_name: str) -> Optional[bool]:
|
||||
return installed
|
||||
except Exception as err:
|
||||
print(err)
|
||||
return None
|
||||
return None
|
||||
|
@ -1,7 +1,7 @@
|
||||
import time
|
||||
import re
|
||||
|
||||
import package
|
||||
import command
|
||||
import cli
|
||||
import cpu
|
||||
|
||||
@ -94,5 +94,5 @@ def main():
|
||||
print(address.not_valid_prompt())
|
||||
|
||||
if __name__ == "__main__":
|
||||
if package.installed("lm-sensors"):
|
||||
if command.package_installed("lm-sensors"):
|
||||
main()
|
Reference in New Issue
Block a user