def init(browsing, mailing, printing, copyfiles, copysea, ssh, meeting, offline, private, breaks, attacking, t):
activities = createActivityList(browsing, mailing, printing, copyfiles, copysea, ssh, meeting, offline, private, breaks, attacking)
time.sleep(2)
parser = SafeConfigParser()
parser.read("packages/system/config.ini")
subnet, host, hostname = getSubnetHostAndHostname()
global myID
if platform.system() == "Linux":
myID = str(getnode())
else:
# For Windows, something must be trickled, since getnode () returns an incorrect value
hexMac = check_output(["getmac"])[162:180]
hexMacNoDash = hexMac.replace("-", "")
intMac = int(hexMacNoDash, 16)
myID = str(intMac)
global pathForLog
if platform.system() == "Linux":
pathForLog = "/home/debian/log/"
else:
pathForLog = "M:\\"
# In endless loop perform different activities
try:
while True:
if isWorkday(parser) and isWorkingHours(parser):
doSomething(activities)
else:
# Should be just the end of his work, he must wait until he has to work again
time.sleep(random.randint(1, 15)*60 - random.randint(1, 55))
except KeyboardInterrupt:
echoC(__name__, "SCRIPT STOPPED: KEYBOARDINTERRUPT")
sys.exit(0)
评论列表
文章目录