rendered paste body#!/usr/bin/python
#Fake ifconfig
import sys
def ifconf():
print """
eth0 Link encap:Ethernet HWaddr 00:14:22:92:30:92
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:217
eth1 Link encap:Ethernet HWaddr 00:90:4B:E8:BE:4D
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::290:4bff:fee8:be4d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:775930 errors:0 dropped:0 overruns:0 frame:0
TX packets:777795 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:592340891 (564.9 Mb) TX bytes:106976006 (102.0 Mb)
Interrupt:209 Memory:dfbfe000-dfc00000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1068 errors:0 dropped:0 overruns:0 frame:0
TX packets:1068 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:67908 (66.3 Kb) TX bytes:67908 (66.3 Kb)
"""
if len(sys.argv) == 1:
ifconf()
for arg in sys.argv[1:]:
if arg.lower() == "-a":
ifconf()