From 5c0e5dea358c2e0c58e5650020360bcc4f8d11fd Mon Sep 17 00:00:00 2001 From: Marius van Witzenburg Date: Tue, 21 Apr 2020 00:23:17 +0200 Subject: [PATCH 1/3] Removed duplicate for colors.pre.sh --- usr/local/bin/bastille | 1 - 1 file changed, 1 deletion(-) diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index 34f43a6f..dccd2ce7 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -47,7 +47,6 @@ bastille_root_check ## we only load the config if root_check passes . /usr/local/etc/bastille/bastille.conf -. /usr/local/share/bastille/colors.pre.sh ## bastille_prefix should be 0750 ## this restricts file system access to privileged users From cdda90fa69aa3b15940c4972138b5fc37f9b1f03 Mon Sep 17 00:00:00 2001 From: Marius van Witzenburg Date: Tue, 21 Apr 2020 02:33:38 +0200 Subject: [PATCH 2/3] Remove duplicate config loading --- usr/local/bin/bastille | 3 --- 1 file changed, 3 deletions(-) diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index dccd2ce7..b7c7df07 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -64,9 +64,6 @@ bastille_perms_check() { bastille_perms_check -## we only load the config if root_check passes -. /usr/local/etc/bastille/bastille.conf - ## version BASTILLE_VERSION="0.6.20200414" From b80bbfe838d537b00f4093c26714c371a2d01be2 Mon Sep 17 00:00:00 2001 From: Marius van Witzenburg Date: Tue, 21 Apr 2020 02:34:02 +0200 Subject: [PATCH 3/3] 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