summaryrefslogtreecommitdiffstats
path: root/command-stubs
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2001-02-22 21:27:55 +0000
committerErik Troan <ewt@redhat.com>2001-02-22 21:27:55 +0000
commit5339b5f9f27596a696def0a0528af663a3ff53bd (patch)
tree284596485760303198f7501afb582c858bc09f5d /command-stubs
parenta4083f873cc5e8e3fc1b9662b646492ce92e6a43 (diff)
downloadanaconda-5339b5f9f27596a696def0a0528af663a3ff53bd.tar.gz
anaconda-5339b5f9f27596a696def0a0528af663a3ff53bd.tar.xz
anaconda-5339b5f9f27596a696def0a0528af663a3ff53bd.zip
added pump program for rescue mode
Diffstat (limited to 'command-stubs')
-rwxr-xr-xcommand-stubs/pump-stub36
1 files changed, 36 insertions, 0 deletions
diff --git a/command-stubs/pump-stub b/command-stubs/pump-stub
new file mode 100755
index 000000000..936315358
--- /dev/null
+++ b/command-stubs/pump-stub
@@ -0,0 +1,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)