Skip to content
Snippets Groups Projects
Select Git revision
  • ec3202170c13fb1876c086b6ab0c8a4a8f9e16fd
  • master default protected
  • nrb-domain-director
  • nrb-set-segment-lua
  • set-segment-noifupdown
  • nrbffs/more-dns-debug
  • nrbffs/domain-trial
  • nrb/allow-wan-status
8 results

ffrn-lowmem

Blame
  • generate.pl 402 B
    use warnings;
    
    
    my %config;
    
    sub add_config {
    	my ($prefix, $c) = @_;
    
    	foreach my $key (keys $c) {
    		my $val = $c->{$key};
    
    		if (ref($val) eq 'HASH') {
    			add_config($key . '.', $val);
    		}
    		unless (ref($val)) {
    			$config{'@' . $prefix . $key . '@'} = $val;
    		}
    	}
    }
    
    add_config('', $CONFIG);
    
    
    my $regex = join '|', map {quotemeta} keys %config;
    
    
    for (<>) {
    	s/($regex)/${config{$1}}/g;
    	print;
    }