Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. #!/usr/bin/python
  2. import os
  3. from socket import *
  4. from time import sleep
  5.  
  6. s=socket(AF_INET, SOCK_DGRAM)
  7. s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
  8. while(1):
  9.     p = os.popen("(ifconfig eth0; ifconfig wlan0)","r")
  10.     line=""
  11.     while 1:
  12.     l=p.readline()
  13.     line+=l
  14.         if not l: break
  15.     s.sendto(line+"\n" , ("255.255.255.255",55555))
  16.     sleep(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement