Skip to content

Commit 4df102f

Browse files
authored
add browsers-file to goan_config if ENABLE_BROWSERS_LIST is true
1 parent a9ed0e9 commit 4df102f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

resources/scripts/logs/npm_redirection.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ function npm_redirect_goaccess_config(){
3838
echo "port 7891" >> ${goan_config}
3939
echo "real-time-html true" >> ${goan_config}
4040
echo "output ${nginx_html}" >> ${goan_config}
41+
if [[ "${ENABLE_BROWSERS_LIST}" == "True" || ${ENABLE_BROWSERS_LIST} == true ]]; then
42+
echo -e "\n\tENABLING NPM REDIRECTION INSTANCE GOACCESS BROWSERS LIST"
43+
browsers_file="/goaccess-config/browsers.list"
44+
echo "browsers-file ${browsers_file}" >> ${goan_config}
45+
fi
4146
}
4247

4348
function npm_redirect(){
@@ -57,7 +62,7 @@ function npm_redirect(){
5762

5863
echo -e "\n#GOAN_NPM_REDIRECT_FALLBACK_DEAD_FILES" >> ${goan_config}
5964
if [[ -d "${goan_log_path}" ]]; then
60-
65+
6166
echo -e "\n\tAdding redirection/fallback/dead logs..."
6267
IFS=$'\n'
6368
for file in $(find "${goan_log_path}" \( -name 'redirection*host-*.log' -o -name 'fallback_access.log' -o -name 'dead-host*.log' \) ! -name "*_error.log*");
@@ -81,9 +86,9 @@ function npm_redirect(){
8186
echo -e "\tFALSE"
8287
goan_archive_log_count=$(find "${goan_log_path}" -type f \( -name 'redirection*host-*.log*.gz' -o -name 'fallback_access.log*.gz' -o -name 'dead-host*.log*.gz' \) ! -name "*_error.log*" | wc -l)
8388
goan_archive_detail_log_count=0
84-
89+
8590
if [ $goan_archive_log_count != 0 ]
86-
then
91+
then
8792
echo -e "\n\tAdding redirection/fallback/dead archive logs..."
8893

8994
IFS=$'\n'
@@ -98,7 +103,7 @@ function npm_redirect(){
98103
unset IFS
99104

100105
echo -e "\n\tAdded (${goan_archive_detail_log_count}) redirection/fallback/dead archived logs from ${goan_log_path}..."
101-
106+
102107
else
103108
echo -e "\tNo redirection/fallback archived logs found at ${goan_log_path}..."
104109
fi

0 commit comments

Comments
 (0)