From 01d7d908f8da426b955e891ab914ebf39d811536 Mon Sep 17 00:00:00 2001 From: r4sas Date: Wed, 15 Feb 2017 20:17:48 +0300 Subject: [PATCH] add curl exists check Former-commit-id: f2c1f9b990a13c1afcd72461ed6069c869b2a796 --- linux/build/i2pdbrowserportable.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/linux/build/i2pdbrowserportable.sh b/linux/build/i2pdbrowserportable.sh index 35b624c..82cfcde 100755 --- a/linux/build/i2pdbrowserportable.sh +++ b/linux/build/i2pdbrowserportable.sh @@ -11,6 +11,12 @@ language=$(echo $LANG | cut -c-5 | sed s/_/-/g) version="45.7.0esr" application="firefox" +curlfind=$(find /bin /usr/bin /usr/sbin /usr/local/bin -type f -name curl) +if [ -z $curlfind ]; then + echo "Can't find cURL installed. That script needs it!"; + exit 1; +fi + echo "This script prepearing $application $version for use with I2Pd" file="$application-$version.tar.bz2" @@ -19,6 +25,7 @@ url="https://ftp.mozilla.org/pub/$application/releases/$version/linux-$arch/$lan echo "Downloading $application..." curl -L -f -# -O $url if [ $? -ne 0 ]; then # Not found error, trying to cut language variable + echo "I'll try download Firefox with shortener language code"; language=$(echo $language | cut -c-2) # re-create variable with cutted lang url="https://ftp.mozilla.org/pub/$application/releases/$version/linux-$arch/$language/$file"