old_contents: #!/usr/bin/python -B
  
  import os, signal, sys, argparse, threading, json, logging, tempfile, time
  import lib
  from lib.rconprotocol import Rcon
  
  pid = str(os.getpid())
  
  _DESC = 'Python Rcon CLI for Arma servers'
  _VER = '0.2'
  
  parser = argparse.ArgumentParser(description=_DESC)
  parser.add_argument('configfile', help='configuration file in JSON')
  parser.add_argument('-g','--gui', action='store_true',help='open the GUI - no other events are enabled')
  args = parser.parse_args()
  
  GUI = args.gui
  
  if not os.path.isfile(args.configfile):
      print('')
      print(' -- Configuration not found: "{}" --\n').format(args.configfile)
      exit(1)
  
  with open(args.configfile) as json_config:
      config = json.load(json_config)
  
  _bstr = os.path.basename(args.configfile)
  _n = 48 - len(_bstr)
  
  print("py3rcon version: %s - running on %s\n" % (_VER, os.name))
  
  # Logging tool configuration
  print('Logging to: {}'.format(config['logfile']))
  FORMAT = '%(asctime)-15s %(levelname)s %(message)s'
  logging.basicConfig(filename=config['logfile'], level=config['loglevel'], format=FORMAT)
  pidfile = '{}/py3rcon.{}.run'.format(tempfile.gettempdir(),config['server']['port'])
  
  if not(GUI):
      if os.path.isfile(pidfile):
          _tmp =('pyrcon is already running for {}:{}'.format(config['server']['host'], config['server']['port']))
          print(_tmp)
          logging.info(_tmp)
          exit()
  
      open(pidfile, 'w').write(pid)
  
  try:
      ##
      # Initialize the rconprotocol class
      ##
      rcon = Rcon(config['server']['host'], config['server']['rcon_password'], config['server']['port'])
  
      if not(GUI):
          # Load the rconrestart module and setup from configuration
          rcon.loadmodule('rconrestart', 'RconRestart', config['restart'])
          # Load the rconmessage module and setup from configuration
          rcon.loadmodule('rconmessage', 'RconMessage', config['repeatMessage'])
          # Load the rcon admin commands module
          if 'commands' in config: rcon.loadmodule('rconcommand', 'RconCommand', config['commands'])
  
      if 'whitelist' in config:
          rcon.loadmodule('rconwhitelist', 'RconWhitelist', config['whitelist'])
          
      if GUI:
          rcon.loadmodule('rcongui', 'RconGUI', config)
  
      # connect to server (async)
      rcon.connectAsync()
      print("Press CTRL + C to Exit")
      while rcon.isExit == False:
          time.sleep(1)
  except (KeyboardInterrupt, SystemExit):
      rcon.Abort()
  except:
      raise
  finally:
      if not(GUI): os.unlink(pidfile)
  
new_contents: #!/usr/bin/python -B
  
  import os, signal, sys, argparse, threading, json, logging, tempfile, time
  import lib
  from lib.rconprotocol import Rcon
  
  pid = str(os.getpid())
  
  _DESC = 'Python Rcon CLI for Arma servers'
  _VER = '0.2'
  
  parser = argparse.ArgumentParser(description=_DESC)
  parser.add_argument('configfile', help='configuration file in JSON')
  parser.add_argument('-g','--gui', action='store_true',help='open the GUI - no other events are enabled')
  args = parser.parse_args()
  
  GUI = args.gui
  
  if not os.path.isfile(args.configfile):
      print('')
      print(' -- Configuration not found: "{}" --\n').format(args.configfile)
      exit(1)
  
  with open(args.configfile) as json_config:
      config = json.load(json_config)
  
  print("py3rcon version: %s - running on %s\n" % (_VER, os.name))
  
  # Logging tool configuration
  print('Logging to: {}'.format(config['logfile']))
  FORMAT = '%(asctime)-15s %(levelname)s %(message)s'
  logging.basicConfig(filename=config['logfile'], level=config['loglevel'], format=FORMAT)
  pidfile = '{}/py3rcon.{}.run'.format(tempfile.gettempdir(),config['server']['port'])
  
  if not(GUI):
      if os.path.isfile(pidfile):
          _tmp = 'pyrcon is already running for %s:%s' % (config['server']['host'], config['server']['port'])
          print(_tmp)
          logging.info(_tmp)
          exit()
  
      open(pidfile, 'w').write(pid)
  
  try:
      ##
      # Initialize the rconprotocol class
      ##
      rcon = Rcon(config['server']['host'], config['server']['rcon_password'], config['server']['port'])
  
      if not(GUI):
          # Load the rconrestart module and setup from configuration
          rcon.loadmodule('rconrestart', 'RconRestart', config['restart'])
          # Load the rconmessage module and setup from configuration
          rcon.loadmodule('rconmessage', 'RconMessage', config['repeatMessage'])
          # Load the rcon admin commands module
          if 'commands' in config: rcon.loadmodule('rconcommand', 'RconCommand', config['commands'])
  
      if 'whitelist' in config:
          rcon.loadmodule('rconwhitelist', 'RconWhitelist', config['whitelist'])
          
      if GUI:
          rcon.loadmodule('rcongui', 'RconGUI', config)
  
      # connect to server (async)
      rcon.connectAsync()
      print("Press CTRL + C to Exit")
      while rcon.isExit == False:
          time.sleep(1)
  except (KeyboardInterrupt, SystemExit):
      rcon.Abort()
  except:
      raise
  finally:
      if not(GUI): os.unlink(pidfile)
  
subject: remove old line