]>
Commit | Line | Data |
---|---|---|
0909c0d1 SS |
1 | #!/bin/bash |
2 | ||
a3f4b8c6 | 3 | # Get the GeoIP database if no one exists yet |
0909c0d1 | 4 | |
a3f4b8c6 MT |
5 | database_exists() { |
6 | local file | |
7 | for file in /usr/share/xt_geoip/*.iv4; do | |
8 | [ -e "${file}" ] && return 0 | |
9 | done | |
0909c0d1 | 10 | |
a3f4b8c6 MT |
11 | # Does not exist |
12 | return 1 | |
13 | } | |
0909c0d1 SS |
14 | |
15 | # Download ruleset if none has been found. | |
a3f4b8c6 | 16 | if ! database_exists; then |
16cb6ae3 | 17 | /usr/local/bin/xt_geoip_update >/dev/null 2>&1 & |
0909c0d1 SS |
18 | fi |
19 | ||
20 | exit 0 |