DEVELOPMENT ENVIRONMENT

~liljamo/robots.txt

ref: c8d6ca21955c2194fa482dc509765ad88ec7ff7f robots.txt/generate-nginx.sh -rwxr-xr-x 415 bytes
c8d6ca21Jonni Liljamo feat: generate-nginx.sh 27 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash

out="if (\$http_user_agent ~* \""

# loop lists
for filename in ./lists/*.txt; do
    # line by line
    while read -r line; do
        # ignore empty
        [ -z "$line" ] && continue
        # ignore comments
        [[ $line =~ ^#.* ]] && continue

        # add to out
        out="$out$line|"
    done < $filename
done

out=${out::-1}
out="$out\") {\n    return 403;\n}\n"

printf "$out"