import hashlib
from urllib.request import urlopen
import json
import os.path
import os
import subprocess
import fcntl, socket, struct

def getHwAddr(ifname):
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    info = fcntl.ioctl(s.fileno(), 0x8927,  struct.pack('256s', bytes(ifname, 'utf-8')[:15]))
    return ':'.join('%02x' % b for b in info[18:24])



content = getHwAddr('eth0')
content = urlopen('http://7-o.cc/clientapp/cl_first.php?firstAccess=true&mac=' + content).read()

subprocess.getstatusoutput("rm /usr/script/scriptFirstActivation.py")