Added hubic status script

master
lanxu 2018-10-20 19:15:34 +03:00
parent f912d3d912
commit 6cd4bc8ea2
1 changed files with 16 additions and 0 deletions

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))