#!/usr/bin/python3 import sys from websocket import create_connection host = sys.argv[1] try: ws = create_connection(host) ws.close() connectionState = 1 except Exception: connectionState = 0 print(connectionState)