Check if required packages are installed

- Check for ansible, pwgen and jq
This commit is contained in:
Sebastian Haderecker
2019-04-13 00:20:26 +00:00
parent de6735e309
commit 0415827f08

View File

@ -1,5 +1,25 @@
#!/bin/bash
# Check if required packages are installed
if ! hash ansible 2>/dev/null; then
echo "Package 'ansible' is missing. Please install it with:"
echo " sudo apt-add-repository --yes --update ppa:ansible/ansible"
echo " sudo apt install ansible"
exit 1
fi
if ! hash pwgen 2>/dev/null; then
echo "Package 'pwgen' is missing. Please install it with:"
echo " sudo apt install pwgen"
exit 1
fi
if ! hash jq 2>/dev/null; then
echo "Package 'jq' is missing. Please install it with:"
echo " sudo apt install jq"
exit 1
fi
# Import ECS settings
source .ecs_settings.sh