isengard-bot/xmpp-notification.py

21 lines
369 B
Python
Executable File

#!/usr/bin/env python3
import socket
import sys,os
s = socket.socket()
port = 12346 # Define the port on which you want to connect
s.connect(('127.0.0.1', port)) # Connect to the server on local computer
str = "%s|%s" % (sys.argv[1], sys.argv[2])
s.send(str.encode())
if s.recv(1024) != b'': # Receive data from the server
exit(1)
s.close()
exit(0)