diff --git a/hubic.py b/hubic.py new file mode 100755 index 0000000..08f93ad --- /dev/null +++ b/hubic.py @@ -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)) +