Add Internet connection check

This commit is contained in:
LukeeGD 2020-03-04 23:19:01 +08:00
parent 3d6dfb0999
commit 3f60477e35

View File

@ -99,7 +99,7 @@ function SaveOTABlobs {
curl -L -# "https://api.ipsw.me/v2.1/ota.json/condensed" -o "ota.json"
fi
echo 'Copying ota.json to tmp...'
echo "Copying ota.json to tmp..."
if [ $platform == macos ]; then
cp ota.json $TMPDIR
else
@ -361,7 +361,7 @@ function Ubuntu1804 {
ar x libcurl3* data.tar.xz
tar xf data.tar.xz
sudo cp usr/lib/${mtype}-linux-gnu/libcurl.so.4.* /usr/lib/libcurl.so.3
curl -L -# http://mirrors.edge.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1_${mtype}.deb -o libpng12.deb
curl -L http://mirrors.edge.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1_${mtype}.deb -o libpng12.deb
sudo dpkg -i libpng12.deb
cd ..
rm -rf tmp
@ -384,6 +384,11 @@ else
exit
fi
if [[ ! $(ping -c1 google.com 2>/dev/null) ]]; then
echo "Please check your Internet connection before proceeding"
exit
fi
HardwareModel=$(ideviceinfo -s | grep 'HardwareModel' | cut -c 16-)
HardwareModelLower=$(echo $HardwareModel | tr '[:upper:]' '[:lower:]' | sed 's/.\{2\}$//')
ProductType=$(ideviceinfo -s | grep 'ProductType' | cut -c 14-)