ACC SHELL

Path : /usr/share/YaST2/scrconf/
File Upload :
Current File : //usr/share/YaST2/scrconf/sysconfig_SuSEfirewall2.scr

/**
 * File:        cfg_firewall2.scr
 * Summary:     Agent for reading/writing /etc/sysconfig/SuSEfirewall2
 * Author:      Lukas Ocilka <lukas.ocilka@suse.cz>
 * Access:      read / write
 *
 * Example:
 *   Dir(.sysconfig.SuSEfirewall2)
 *   (["FW_ROUTE", ...])
 **
 *   Read(.sysconfig.SuSEfirewall2.FW_ROUTE)
 *   ("yes")
 **
 *   Write(.sysconfig.SuSEfirewall2.FW_ROUTE, "no")
 *   (true)
 **
 *   // Don't forget to write nil to sync the settings!
 *   Write(.sysconfig.SuSEfirewall2, nil)
 *
 * $Id: sysconfig_SuSEfirewall2.scr 61236 2010-03-10 15:39:50Z mvidner $
 *
 * Read/Sets the values defined in /etc/sysconfig/SuSEfirewall2
 * in an easy manner.
 */
.sysconfig.SuSEfirewall2

`ag_ini(
    `IniAgent (
	"/etc/sysconfig/SuSEfirewall2",
	$[
	    // do not join_multiline, "\n" are replaced with " " later
	    "options" : [ "line_can_continue", "global_values", "comments_last", "flat", ],
	    "comments": [ "^[ \t]*#.*$", "#.*", "^[ \t]*$", ],
	    "params" : [
		$[
		    "match" : [ "([a-zA-Z0-9_]+)[ \t]*=[ \t]*\"([^\"]*)\"", "%s=\"%s\"" ],
		    "multiline" : [ "([a-zA-Z0-9_]+)[ \t]*=[ \t]*\"([^\"]*)", "([^\"]*)\"", ],
		],
		// also single quotes, bnc#327565
		$[
		    "match" : [ "([a-zA-Z0-9_]+)[ \t]*=[ \t]*'([^']*)'", "%s=\"%s\"" ],
		    "multiline" : [ "([a-zA-Z0-9_]+)[ \t]*=[ \t]*'([^']*)", "([^\']*)'", ],
		],
		$[
		    "match" : [ "([a-zA-Z0-9_]+)[ \t]*=[ \t]*([^\"]*[^ \t\"]|)[ \t]*$", "%s=\"%s\"",],
		],
	    ],
	]
    )
)

ACC SHELL 2018