diff options
Diffstat (limited to 'web/api/read/template-list')
-rwxr-xr-x | web/api/read/template-list | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/web/api/read/template-list b/web/api/read/template-list index d1c8773..81b9986 100755 --- a/web/api/read/template-list +++ b/web/api/read/template-list @@ -6,10 +6,10 @@ use nms::web; use strict; use warnings; -my $template_dir = "/opt/gondul/web/templates"; - -opendir (DIR, $template_dir) or die $!; +my @dirs = ("/opt/gondul/web/templates","/opt/gondul/data/templates"); +foreach my $template_dir (@dirs) { +opendir (DIR, $template_dir) or next; while (my $file = readdir(DIR)) { next if ($file =~ m/^\./); my %meh; @@ -17,5 +17,5 @@ while (my $file = readdir(DIR)) { push @{$nms::web::json{'templates'}},\%meh; } - +} nms::web::finalize_output(); |