From 4dbb9752708ca966d668022caeb0f3fbe88cec04 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Mon, 9 Apr 2018 17:38:38 +1200 Subject: Add prototype timezone functionality --- config_file.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'config_file.pm') diff --git a/config_file.pm b/config_file.pm index 2ad6620..5ee51d8 100644 --- a/config_file.pm +++ b/config_file.pm @@ -58,6 +58,16 @@ sub parse_config $triggers{$match} = $response; } + # special case: timezones hash + my %timezone; + foreach (split ',', $config->{_}->{timezone}) { + my ($who, $tz) = split /=>/; + # strip outer quotes + $who =~ s/^[^']*'|'[^']*$//g; + $tz =~ s/^[^']*'|'[^']*$//g; + $timezone{$who} = $tz; + } + $built_config{uid} = getpwnam($built_config{user}) or die "Cannot get uid of $built_config{user}: $!\n"; $built_config{gid} = getgrnam($built_config{group}) @@ -65,6 +75,7 @@ sub parse_config $built_config{triggers} = \%triggers; + $built_config{timezone} = \%timezone; return %built_config; } -- cgit v1.1