Skip to content

Commit

Permalink
fix some indentation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
drubicza committed Jul 9, 2012
1 parent 70f2292 commit 9e705a2
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions etherwall.py
Expand Up @@ -18,45 +18,45 @@ def help():
"""
print ("Usage: %s {start|stop|restart|status}" % (sys.argv[0]))
sys.exit(2)

if (__name__ == "__main__"):
"""
Basic checking for user permissions.
"""
if os.getuid():
print ("[-] Operation not permitted, User must be root.")
sys.exit(1)

"""
Instance etherwall class
"""
service = etherWall(pidfile = '/var/run/etherwall.pid',name='etherwall')

if (len(sys.argv) == 2):
if ('start' == sys.argv[1]):
# start the daemon
service.start()
sys.exit(0)
elif ('stop' == sys.argv[1]):
# kill the daemon
service.stop()
# change the ARP tables rules, Inclusive -> Exclusive
chain_stop()
# flushing arp cache
flush_arp_cache()
elif ('restart' == sys.argv[1]):
# restart the daemon
service.restart()
elif ('status' == sys.argv[1]):
# check etherwall status
if service.status():
print ("Etherwall daemon is running...")
if ('start' == sys.argv[1]):
# start the daemon
service.start()
sys.exit(0)
elif ('stop' == sys.argv[1]):
# kill the daemon
service.stop()
# change the ARP tables rules, Inclusive -> Exclusive
chain_stop()
# flushing arp cache
flush_arp_cache()
elif ('restart' == sys.argv[1]):
# restart the daemon
service.restart()
elif ('status' == sys.argv[1]):
# check etherwall status
if service.status():
print ("Etherwall daemon is running...")
else:
print ("Etherwall daemon is not running, Please check logfile `/var/log/etherwall/etherwall.log' for more information.")
else:
print ("Etherwall daemon is not running, Please check logfile `/var/log/etherwall/etherwall.log' for more information.")
else:
help()
sys.exit(0)
help()
sys.exit(0)
else:
help()
help()

## EOF ##

0 comments on commit 9e705a2

Please sign in to comment.