Files
OpenVPNAdapter/deps/functions.sh
Sergey Abramchuk 055bb04c14 Squashed 'OpenVPN Adapter/Vendors/openvpn/' changes from 3e002c83c..098fd412a
098fd412a [OVPN3-182] mac: add XCode project
fd5fa9403 [OI-29] Report IV_HWADDR on iOS
d3dd348c0 [OVPN3-165] send keydir opt string only when tls-auth is enabled
d0532df66 mbedTLS: add support for ECDSA
fa872c4ff [OVPN3-146] build: switch from sha256sum to shasum -a 256

git-subtree-dir: OpenVPN Adapter/Vendors/openvpn
git-subtree-split: 098fd412a26b681e55e8c3de924d133f5547fd2f
2018-02-23 12:14:04 +03:00

31 lines
521 B
Bash

function check_download()
{
if [ -f $DL/$FNAME ]; then
CHECK=$(shasum -a 256 $DL/$FNAME |awk '{printf $1};')
if [ "$CHECK" == "$CSUM" ]; then
return 0
else
echo "Checksum mismatch for $FNAME. Was $CHECK, expected $CSUM"
fi
else
echo "$FNAME not found."
fi
return -1
}
function download()
{
check_download && return 0
rm -f $DL/$FNAME
if [ -n "$URL" ]; then
wget $URL -O $DL/$FNAME
else
echo URL must be specified
exit 1
fi
check_download || return -1
}