Added hubic status script

This commit is contained in:
lanxu 2018-10-20 19:15:34 +03:00
parent f912d3d912
commit 6cd4bc8ea2

16
hubic.py Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/python
import os
import re
import lib.helpers as helpers
from subprocess import check_output
hubic_available = helpers.is_exe('/usr/bin/hubic')
if not hubic_available:
print('Not running')
os.exit(1)
return_value = check_output(['hubic', 'status'])
m = re.search(r'State: (.*)', return_value.decode("utf-8"))
print(m.group(1))