1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-20 02:52:11 +00:00

fixed MIAB agreement config from writing

This commit is contained in:
EliterScripts 2019-04-09 22:56:52 -07:00
parent f6a122ef43
commit 24953ab912
3 changed files with 17 additions and 16 deletions

View File

@ -269,20 +269,14 @@ function set_config_agreed {
set_storage_user;
set_storage_root;
if [ -z "${I_AGREE_MAILINABOX:-}" ]; then
if [ ! -d $STORAGE_ROOT ]; then
return 1
fi
if [ ! -f $STORAGE_ROOT/settings.yaml ]; then
return 1
fi
local current_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
local yaml_agreed=$(python set "${current_directory}"/checkagree.py "${STORAGE_ROOT}/settings.yaml")
if [ "$yaml_agreed" -eq "true"]; then
return 0
fi
return 1
else
if [ ! -d $STORAGE_ROOT ]; then
mkdir -p $STORAGE_ROOT
fi
local current_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
local yaml_agreed=$(python set "${current_directory}"/checkagree.py "${STORAGE_ROOT}/settings.yaml")
if [ "$yaml_agreed" == "true"]; then
return 0
fi
return 1
}

View File

@ -43,11 +43,11 @@ if [ -z "${NONINTERACTIVE:-}" ]; then
fi
fi
I_AGREE_MAILINABOX=$(/bin/true)
I_AGREE_MAILINABOX="$(/bin/true)"
else
if [ $(check_config_agreed; echo $?) -eq "0" ]; then
I_AGREE_MAILINABOX=$(/bin/true)
I_AGREE_MAILINABOX="$(/bin/true)"
fi
#This is so a user can programmatically agree to our legal notice
@ -241,3 +241,7 @@ if [ -f /usr/bin/git ] && [ -d .git ]; then
echo "Mail-in-a-Box Version: " $(git describe)
fi
echo
function get_I_AGREE_MAILINABOX(){
echo "$I_AGREE_MAILINABOX"
}

View File

@ -57,6 +57,9 @@ chmod +x /usr/local/bin/mailinabox
# STORAGE_ROOT.
source setup/questions.sh
I_AGREE_MAILINABOX=$(check_config_agreed; echo $?)
if [ -z "${I_AGREE_MAILINABOX:-}" ]; then
echo "ERROR: You must agree to Mail-in-a-Box's Legal Notice. You can either:"
echo "run this in interactive mode; or"