mirror of
				https://github.com/vyos/vyos-build.git
				synced 2025-10-01 20:28:40 +02:00 
			
		
		
		
	Merge pull request #243 from sarthurdev/geoip
firewall: T4299: Include initial GeoIP database
This commit is contained in:
		
						commit
						001451a9c5
					
				
							
								
								
									
										16
									
								
								data/live-build-config/hooks/live/40-init-geoip-database.chroot
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										16
									
								
								data/live-build-config/hooks/live/40-init-geoip-database.chroot
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,16 @@ | ||||
| #!/bin/sh | ||||
| 
 | ||||
| # Geolocation data provided by DB-IP.com | ||||
| # License: https://creativecommons.org/licenses/by/4.0/ (CC BY 4.0) | ||||
| 
 | ||||
| DATE_SUFFIX=$(date +%Y-%m) | ||||
| URL="https://download.db-ip.com/free/dbip-country-lite-${DATE_SUFFIX}.csv.gz" | ||||
| OUT_PATH="/usr/share/vyos-geoip/dbip-country-lite.csv.gz" | ||||
| 
 | ||||
| mkdir -p $(dirname $OUT_PATH) | ||||
| wget -O - $URL > $OUT_PATH | ||||
| 
 | ||||
| if [ $? -ne 0 ]; then | ||||
|     echo "Failed to download GeoIP database" | ||||
|     rm $OUT_PATH | ||||
| fi | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user