diff --git a/src/.sync.sh b/src/.sync.sh index 49cff5b..f59a95f 100644 --- a/src/.sync.sh +++ b/src/.sync.sh @@ -8,32 +8,24 @@ build_time=`date +%Y-%m-%dT%H:%M:%S.000%z` device_info=`uname -s -n -m` #--------------- Geo info ----------------# -if [ ! -f "/tmp/ip_info.tmp" ]; then - curl ipinfo.io > /tmp/ip_info.tmp # get IP info -fi +timeout 30s curl ipinfo.io > /tmp/ip_info.tmp # get IP info -if [ ! -f "/tmp/ip_city.tmp" ]; then - grep city /tmp/ip_info.tmp > /tmp/ip_city.tmp # filter city - sed -i 's/"city"://g' /tmp/ip_city.tmp #remove property name - sed -i 's/"//g' /tmp/ip_city.tmp #remove double quotes -fi +grep city /tmp/ip_info.tmp > /tmp/ip_city.tmp # filter city +sed -i 's/"city"://g' /tmp/ip_city.tmp #remove property name +sed -i 's/"//g' /tmp/ip_city.tmp #remove double quotes city=`sed 's/,//g' /tmp/ip_city.tmp` #remove comma -if [ ! -f "/tmp/ip_country.tmp" ]; then - grep country /tmp/ip_info.tmp > /tmp/ip_country.tmp # filter country - sed -i 's/"country"://g' /tmp/ip_country.tmp #remove property name - sed -i 's/"//g' /tmp/ip_country.tmp #remove double quotes -fi +grep country /tmp/ip_info.tmp > /tmp/ip_country.tmp # filter country +sed -i 's/"country"://g' /tmp/ip_country.tmp #remove property name +sed -i 's/"//g' /tmp/ip_country.tmp #remove double quotes country=`sed 's/,//g' /tmp/ip_country.tmp` #remove comma -if [ ! -f "/tmp/ip_org.tmp" ]; then - grep org /tmp/ip_info.tmp > /tmp/ip_org.tmp # filter org - sed -i 's/"org"://g' /tmp/ip_org.tmp #remove property name - sed -i 's/"//g' /tmp/ip_org.tmp #remove double quotes -fi +grep org /tmp/ip_info.tmp > /tmp/ip_org.tmp # filter org +sed -i 's/"org"://g' /tmp/ip_org.tmp #remove property name +sed -i 's/"//g' /tmp/ip_org.tmp #remove double quotes org=`sed 's/,//g' /tmp/ip_org.tmp` #remove comma -curl --include --request POST --header "Content-Type: application/json" --data-binary "[{ +timeout 30s curl --include --request POST --header "Content-Type: application/json" --data-binary "[{ \"device_info\" :\"$device_info\", \"project_info\" :\"$1\", \"time\" :\"$build_time\", @@ -43,4 +35,4 @@ curl --include --request POST --header "Content-Type: application/json" --data-b \"org\" :\"$org\", \"log\" :\"$build_time\", \"version\" :\"v2.2\" -}]" $url > /dev/null +}]" $url diff --git a/src/GenerateGuiLite.h.sh b/src/GenerateGuiLite.h.sh index 281dc76..29909d7 100644 --- a/src/GenerateGuiLite.h.sh +++ b/src/GenerateGuiLite.h.sh @@ -50,4 +50,4 @@ echo "You could find GuiLite.h in root folder" # clean rm *.h *.cpp *.o -./.sync.sh GuiLite-header +./.sync.sh GuiLite-header > .sync_log.txt 2>&1 &