check dependencies

This commit is contained in:
nervuri 2022-08-07 00:00:00 +00:00
parent a43efbcbf7
commit 54fbbd8fc1
Signed by: nervuri
GPG Key ID: C4769EEA7BA61672
1 changed files with 17 additions and 0 deletions

17
main.sh
View File

@ -4,6 +4,23 @@
set -o errexit # (-e) exit immediately if any command has a non-zero exit status
# Check if dependencies are installed.
if ! command -v openssl >/dev/null; then
>&2 echo '"openssl" not installed! [required]'
exit 1
fi
if ! command -v idn >/dev/null; then
>&2 echo '"idn" not installed! [required]'
exit 1
fi
if ! command -v agunua >/dev/null; then
>&2 echo '"agunua" not installed! [required]'
exit 1
fi
if ! command -v torsocks >/dev/null; then
>&2 echo '"torsocks" not installed! [optional]'
fi
# Go where this script is.
cd "$(dirname "$0")" || exit