diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py index 09d32cb2..b710fa3c 100644 --- a/onionshare/onionshare.py +++ b/onionshare/onionshare.py @@ -76,13 +76,13 @@ class OnionShare(object): if not self.port: self.choose_port() + if self.shutdown_timeout > 0: + self.shutdown_timer = ShutdownTimer(self.common, self.shutdown_timeout) + if self.local_only: self.onion_host = '127.0.0.1:{0:d}'.format(self.port) return - if self.shutdown_timeout > 0: - self.shutdown_timer = ShutdownTimer(self.common, self.shutdown_timeout) - self.onion_host = self.onion.start_onion_service(self.port) if self.stealth: diff --git a/onionshare_gui/__init__.py b/onionshare_gui/__init__.py index c3df057b..6254676c 100644 --- a/onionshare_gui/__init__.py +++ b/onionshare_gui/__init__.py @@ -64,7 +64,6 @@ def main(): # Parse arguments parser = argparse.ArgumentParser(formatter_class=lambda prog: argparse.HelpFormatter(prog,max_help_position=48)) parser.add_argument('--local-only', action='store_true', dest='local_only', help=strings._("help_local_only")) - parser.add_argument('--shutdown-timeout', metavar='', dest='shutdown_timeout', default=0, help=strings._("help_shutdown_timeout")) parser.add_argument('--debug', action='store_true', dest='debug', help=strings._("help_debug")) parser.add_argument('--filenames', metavar='filenames', nargs='+', help=strings._('help_filename')) parser.add_argument('--config', metavar='config', default=False, help=strings._('help_config')) @@ -78,7 +77,6 @@ def main(): config = args.config local_only = bool(args.local_only) - shutdown_timeout = int(args.shutdown_timeout) debug = bool(args.debug) # Debug mode? @@ -101,7 +99,7 @@ def main(): onion = Onion(common) # Start the OnionShare app - app = OnionShare(common, onion, local_only, shutdown_timeout) + app = OnionShare(common, onion, local_only) # Launch the gui gui = OnionShareGui(common, onion, qtapp, app, filenames, config, local_only)