From 54fbbd8fc17e72257a6542ae064de0d680538986 Mon Sep 17 00:00:00 2001 From: nervuri Date: Sun, 7 Aug 2022 00:00:00 +0000 Subject: [PATCH] check dependencies --- main.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/main.sh b/main.sh index c5662ef..898095f 100755 --- a/main.sh +++ b/main.sh @@ -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