import subprocess from rich.console import Console host = "fansifter.qaorch.com" def check_vpn_is_working() -> bool: try: subprocess.check_call(["ping", "-c", "4", host], stdout=subprocess.PIPE, stderr=subprocess.PIPE) return True except subprocess.CalledProcessError: return False def alert_message_and_exit(msg, exit_=True) -> None: console = Console() console.print(f"[red]{msg}[/red]") if exit_: exit(1) def print_message(msg, color="green") -> None: console = Console() console.print(f"[{color}]{msg}[/{color}]")