Commit a24ecb2e authored by Julien Muchembled's avatar Julien Muchembled

New --up option

parent 1f6f67aa
...@@ -35,6 +35,8 @@ def getConfig(): ...@@ -35,6 +35,8 @@ def getConfig():
_('-I', '--main-interface', metavar='IFACE', default='lo', _('-I', '--main-interface', metavar='IFACE', default='lo',
help="Set re6stnet IP on given interface. Any interface not used for" help="Set re6stnet IP on given interface. Any interface not used for"
" tunnelling can be chosen.") " tunnelling can be chosen.")
_('--up', metavar='CMD',
help="Shell command to run after successful initialization.")
_ = parser.add_argument_group('routing').add_argument _ = parser.add_argument_group('routing').add_argument
_('-B', dest='babel_args', metavar='ARG', action='append', default=[], _('-B', dest='babel_args', metavar='ARG', action='append', default=[],
...@@ -223,6 +225,10 @@ def main(): ...@@ -223,6 +225,10 @@ def main():
subprocess.call(del_rtr) subprocess.call(del_rtr)
del_rtr[4] = '%s/%u' % (utils.ipFromBin(subnet), len(subnet)) del_rtr[4] = '%s/%u' % (utils.ipFromBin(subnet), len(subnet))
cleanup.append(lambda: subprocess.call(del_rtr)) cleanup.append(lambda: subprocess.call(del_rtr))
if config.up:
r = os.system(config.up)
if r:
sys.exit(r)
# main loop # main loop
if tunnel_manager is None: if tunnel_manager is None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment