Sindbad~EG File Manager

Current Path : /opt/nginxhttpd_/etc/openresty_config/utils/
Upload File :
Current File : //opt/nginxhttpd_/etc/openresty_config/utils/maxmind-geoip2.sh

#!/bin/bash

set -euo pipefail
IFS=$'\n\t'

WORKING_DIR=$(mktemp -d)
COUNTRY_FILE=/tmp/GeoIP2-Country.mmdb
ISP_FILE=/tmp/GeoIP2-ISP.mmdb
CUR_DIR=$(pwd)

cd $WORKING_DIR

wget --timeout=30 -q "http://devel.mcflex.fr/GeoIpDB/GeoIP2-Country.tar.gz"
wget --timeout=30 -q "http://devel.mcflex.fr/GeoIpDB/GeoIP2-ISP.tar.gz"

test -e GeoIP2-Country.tar.gz || (echo "GeoIP2-Country.tar.gz dont exists" && cd $CUR_DIR && rm -fr $WORKING_DIR && exit 1)
test -e GeoIP2-ISP.tar.gz || (echo "GeoIP2-ISP.tar.gz dont exists" && cd $CUR_DIR && rm -fr $WORKING_DIR && exit 1)

tar -xf GeoIP2-Country.tar.gz || (echo "GeoIP2-Country.tar.gz cant extract" && cd $CUR_DIR && rm -fr $WORKING_DIR && exit 1)
tar -xf GeoIP2-ISP.tar.gz || (echo "GeoIP2-ISP.tar.gz cant extract" && cd $CUR_DIR && rm -fr $WORKING_DIR && exit 1)

mv -f GeoIP2-Country*/GeoIP2-Country.mmdb $COUNTRY_FILE
mv -f GeoIP2-ISP*/GeoIP2-ISP.mmdb $ISP_FILE

cd $CUR_DIR

rm -fr $WORKING_DIR

echo "$COUNTRY_FILE"
echo "$ISP_FILE"


Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists