From c1aa2e00724ded8099e11c40098bb96227f1d5f0 Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 16 Jul 2024 21:06:14 +0000 Subject: [PATCH] Init check ping --- README.md | 2 +- check.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 check.py diff --git a/README.md b/README.md index ba47d8e..13992dc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ # Networking * Pinging * Names -* Sending \ No newline at end of file +* Sending Message \ No newline at end of file diff --git a/check.py b/check.py new file mode 100644 index 0000000..7e96075 --- /dev/null +++ b/check.py @@ -0,0 +1,9 @@ +import os +hostname = "google.com" +response = os.system("ping -c 1 " + hostname) +if response == 0: + pingstatus = "Network Active" +else: + pingstatus = "Network Error" + +print(pingstatus) \ No newline at end of file