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:
parent
f6a122ef43
commit
24953ab912
@ -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
|
||||
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" -eq "true"]; then
|
||||
if [ "$yaml_agreed" == "true"]; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
@ -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"
|
||||
}
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user