#!/usr/bin/env python
#coding=utf-8
#eidt newlight
#python
import oside
def ping():
with open('ip.txt','r') as f:
content = f.readlines()
for ip in content:
ret = os.system("ping -c 1 -w 1 %s"%ip)
if ret == 0:
with open('new.txt','a') as c:
c.write(ip)
c.write('online\n')
else:
with open('new.txt','a') as c:
c.write(ip)
c.write('offline\n')
ping()ip