Created
April 24, 2014 18:14
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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