|
|
|
@ -400,18 +400,18 @@ if __name__ == "__main__":
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
result = subprocess.run(query, capture_output=True, text=True, check=True)
|
|
|
|
result = subprocess.run(query, capture_output=True, text=True, check=True)
|
|
|
|
print(f"Command run was: {query}")
|
|
|
|
print(f"Command run was: {query}")
|
|
|
|
gpsd_status = result.stdout
|
|
|
|
gpsd_status = result.stdout.strip()
|
|
|
|
print(f"Output of the command (stdout): {gpsd_status}")
|
|
|
|
print(f"Output of the command (stdout): {gpsd_status}")
|
|
|
|
except subprocess.CalledProcessError as e:
|
|
|
|
except subprocess.CalledProcessError as e:
|
|
|
|
# print(f"Command failed with return code: {e.returncode}")
|
|
|
|
# print(f"Command failed with return code: {e.returncode}")
|
|
|
|
print(f"Command run was: {e.cmd}")
|
|
|
|
print(f"Command run was: {e.cmd}")
|
|
|
|
gpsd_status = e.stdout
|
|
|
|
gpsd_status = e.stdout.strip()
|
|
|
|
print(f"Output of the command (stdout): {e.stdout}")
|
|
|
|
print(f"Output of the command (stdout): {e.stdout}")
|
|
|
|
# print(f"Error output of the command (stderr): {e.stderr}")
|
|
|
|
# print(f"Error output of the command (stderr): {e.stderr}")
|
|
|
|
|
|
|
|
|
|
|
|
if gpsd_status == "active":
|
|
|
|
if (gpsd_status == "active"):
|
|
|
|
print("gpsd status is active"
|
|
|
|
print("gpsd status is active"
|
|
|
|
if gpsd_status == "inactive":
|
|
|
|
if (gpsd_status == "inactive"):
|
|
|
|
print("gpsd status is inactive"
|
|
|
|
print("gpsd status is inactive"
|
|
|
|
|
|
|
|
|
|
|
|
if (mode != 'e') and (gpsd_status != "active"):
|
|
|
|
if (mode != 'e') and (gpsd_status != "active"):
|
|
|
|
|