2
0
mirror of https://github.com/mozilla/cipherscan.git synced 2024-11-22 22:33:40 +01:00
cipherscan/cscan.sh
Hubert Kario 31761fa7b2 make shell scripts respect PATH
use the bash from PATH, not from /bin

fixes #141
2018-05-13 19:33:05 +02:00

29 lines
887 B
Bash
Executable File

#!/usr/bin/env bash
pushd "$(dirname ${BASH_SOURCE[0]})" > /dev/null
if [ ! -d ./tlslite ]; then
echo -e "\n${BASH_SOURCE[0]}: tlslite-ng not found, downloading..." 1>&2
git clone --depth=1 https://github.com/tomato42/tlslite-ng.git .tlslite-ng 1>&2
ln -s .tlslite-ng/tlslite tlslite
fi
if [ ! -d ./ecdsa ]; then
echo -e "\n${BASH_SOURCE[0]}: python-ecdsa not found, downloading..." 1>&2
git clone --depth=1 https://github.com/warner/python-ecdsa.git .python-ecdsa 1>&2
ln -s .python-ecdsa/src/ecdsa ecdsa
fi
# update the code if it is running in interactive terminal
#if [[ -t 1 ]]; then
if [[ $UPDATE ]]; then
pushd .tlslite-ng >/dev/null
git pull origin master --quiet
popd >/dev/null
pushd .python-ecdsa >/dev/null
git pull origin master --quiet
popd >/dev/null
fi
PYTHONPATH=. python cscan.py "$@"
ret=$?
popd > /dev/null
exit $ret