Skip to content

Instantly share code, notes, and snippets.

@takeshixx
Created April 24, 2014 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takeshixx/11264187 to your computer and use it in GitHub Desktop.
Save takeshixx/11264187 to your computer and use it in GitHub Desktop.
Parse jail parameters from FreeBSD /etc/rc.conf file (and all included files)
from sh import sh
dict(_.split('=',1) for _ in [_ for _ in sh('-c','\n'.join([_.strip() for _ in open('/etc/rc.conf').read().split('\n') if not _.startswith('#') and _ is not ''])+'\nset').split('\n') if _.startswith('jail_')])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment