|
@@ -0,0 +1,17 @@
|
|
|
+import socket
|
|
|
+
|
|
|
+from rollbot import as_plugin
|
|
|
+
|
|
|
+from config import get_secret
|
|
|
+
|
|
|
+PLEX_HOST = get_secret("plex.host")
|
|
|
+
|
|
|
+@as_plugin
|
|
|
+def plex():
|
|
|
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
|
+ try:
|
|
|
+ s.connect((PLEX_HOST, 32400))
|
|
|
+ s.shutdown(socket.SHUT_WR)
|
|
|
+ return "Well, something is running on that port so, it's probably up!"
|
|
|
+ except ConnectionRefusedError:
|
|
|
+ return "I couldn't reach plex!"
|