From b80bbfe838d537b00f4093c26714c371a2d01be2 Mon Sep 17 00:00:00 2001 From: Marius van Witzenburg Date: Tue, 21 Apr 2020 02:34:02 +0200 Subject: [PATCH] Add check for config existance and readable --- usr/local/bin/bastille | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index b7c7df07..1fab1637 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -45,7 +45,17 @@ bastille_root_check() { bastille_root_check -## we only load the config if root_check passes +## check for config existance +bastille_conf_check() { + if [ ! -r /usr/local/etc/bastille/bastille.conf ]; then + echo -e "${COLOR_RED}Missing Configuration${COLOR_RESET}" 1>&2 + exit 1 + fi +} + +bastille_conf_check + +## we only load the config if conf_check passes . /usr/local/etc/bastille/bastille.conf ## bastille_prefix should be 0750