Create update_and_restart.sh
Browse files- update_and_restart.sh +16 -0
update_and_restart.sh
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/sh
|
2 |
+
while true;
|
3 |
+
do
|
4 |
+
date
|
5 |
+
echo "updating GeoLite2-City.mmdb..."
|
6 |
+
curl -L -o "GeoLite2-City.mmdb" "https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-City.mmdb"
|
7 |
+
echo "updating GeoLite2-ASN.mmdb..."
|
8 |
+
curl -L -o "GeoLite2-ASN.mmdb" "https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-ASN.mmdb"
|
9 |
+
echo "updating GeoCN.mmdb..."
|
10 |
+
curl -L -o "GeoCN.mmdb" "http://github.com/ljxi/GeoCN/releases/download/Latest/GeoCN.mmdb"
|
11 |
+
|
12 |
+
echo "restarting uvicorn..."
|
13 |
+
pkill -f "uvicorn"
|
14 |
+
nohup uvicorn main:app --host 0.0.0.0 --port 8080 --no-server-header --proxy-headers &
|
15 |
+
sleep 86400;
|
16 |
+
done
|