blob: 936315358fd4a47c8594641ae23c505715a71fd5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/usr/bin/python
import os
import sys
# for testing
if (os.path.exists('isys')):
sys.path.append('isys')
sys.path.append('/usr/lib/anaconda')
import isys
from sys import argv
def usage():
print "usage: pump [-i device]"
sys.exit(1)
iface = "eth0"
argv = argv[1:]
while (argv):
if argv[0] == "-i":
if len(argv) < 2: usage()
iface = argv[1]
argv = argv[2:]
else:
usage()
ns = isys.pumpNetDevice(iface)
if ns:
f = open("/etc/resolv.conf", "w")
f.write("nameserver %s\n" % ns)
f.close()
sys.exit(0)
|