Add Shebang for tools Script

This commit is contained in:
Zen Wen
2025-08-30 14:26:07 +08:00
parent e1fd28f595
commit e4950bbbe6
3 changed files with 27 additions and 24 deletions

View File

@@ -1,4 +1,4 @@
#/bin/bash
#!/bin/bash
cd ../src/mod/geodb
@@ -11,24 +11,25 @@ echo "Updating geodb csv files"
echo "Downloading IPv4 database"
curl -f https://cdn.jsdelivr.net/npm/@ip-location-db/geo-whois-asn-country/geo-whois-asn-country-ipv4.csv -o geoipv4.csv
if [ $? -ne 0 ]; then
echo "Failed to download IPv4 database"
failed=true
echo "Failed to download IPv4 database"
failed=true
else
echo "Successfully downloaded IPv4 database"
echo "Successfully downloaded IPv4 database"
fi
echo "Downloading IPv6 database"
curl -f https://cdn.jsdelivr.net/npm/@ip-location-db/geo-whois-asn-country/geo-whois-asn-country-ipv6.csv -o geoipv6.csv
if [ $? -ne 0 ]; then
echo "Failed to download IPv6 database"
failed=true
echo "Failed to download IPv6 database"
failed=true
else
echo "Successfully downloaded IPv6 database"
echo "Successfully downloaded IPv6 database"
fi
if [ "$failed" = true ]; then
echo "One or more downloads failed. Blocking exit..."
while :; do
read -p "Press [Ctrl+C] to exit..." input
done
fi
echo "One or more downloads failed. Blocking exit..."
while :; do
read -p "Press [Ctrl+C] to exit..." input
done
fi