def _routestopped_config(routestopped):
 if (routestopped is None):
  routestopped = []
 lines = [ROUTESTOPPED_HEADER]
 for entry in routestopped:
  entry.setdefault('interface', 'eth0')
  entry.setdefault('host', '0.0.0.0/0')
  entry.setdefault('options', '-')
  entry.setdefault('proto', '-')
  entry.setdefault('dest_port', '-')
  entry.setdefault('source_port', '-')
  if isinstance(entry['host'], list):
   entry['host'] = ','.join(entry['host'])
  if isinstance(entry['options'], list):
   entry['options'] = ','.join(entry['options'])
  lines.append((ROUTESTOPPED_FORMAT % entry))
 file('/etc/shorewall/routestopped', contents=''.join(lines), use_sudo=True)

def _routestopped_config ( routestopped ) : if ( routestopped is None ) : routestopped = [ ] lines = [ ROUTESTOPPED_HEADER ] for entry in routestopped : entry . setdefault ( 'interface' , 'eth0' ) entry . setdefault ( 'host' , '0.0.0.0/0' ) entry . setdefault ( 'options' , '-' ) entry . setdefault ( 'proto' , '-' ) entry . setdefault ( 'dest_port' , '-' ) entry . setdefault ( 'source_port' , '-' ) if isinstance ( entry [ 'host' ] , list ) : entry [ 'host' ] = ',' . join ( entry [ 'host' ] ) if isinstance ( entry [ 'options' ] , list ) : entry [ 'options' ] = ',' . join ( entry [ 'options' ] ) lines . append ( ( ROUTESTOPPED_FORMAT % entry ) ) file ( '/etc/shorewall/routestopped' , contents = '' . join ( lines ) , use_sudo = True )
routestopped configuration this lists the hosts that should be accessible when the firewall is stopped or starting .