mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-10-30 18:50:53 +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_user; | ||||||
| 	set_storage_root; | 	set_storage_root; | ||||||
| 
 | 
 | ||||||
| 	if [ -z "${I_AGREE_MAILINABOX:-}" ]; then | 	if [ ! -d $STORAGE_ROOT ]; then | ||||||
| 		if [ ! -d $STORAGE_ROOT ]; then | 		mkdir -p $STORAGE_ROOT | ||||||
| 			return 1 | 	fi | ||||||
| 		fi | 
 | ||||||
| 		if [ ! -f $STORAGE_ROOT/settings.yaml ]; then | 	local current_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||||||
| 			return 1 | 	local yaml_agreed=$(python set "${current_directory}"/checkagree.py "${STORAGE_ROOT}/settings.yaml") | ||||||
| 		fi | 	if [ "$yaml_agreed" == "true"]; then | ||||||
| 		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 |  | ||||||
| 		return 0 | 		return 0 | ||||||
| 	fi | 	fi | ||||||
|  | 	return 1 | ||||||
| } | } | ||||||
| @ -43,11 +43,11 @@ if [ -z "${NONINTERACTIVE:-}" ]; then | |||||||
| 		fi | 		fi | ||||||
| 	fi | 	fi | ||||||
| 
 | 
 | ||||||
| 	I_AGREE_MAILINABOX=$(/bin/true) | 	I_AGREE_MAILINABOX="$(/bin/true)" | ||||||
| else | else | ||||||
| 
 | 
 | ||||||
| 	if [ $(check_config_agreed; echo $?) -eq "0" ]; then | 	if [ $(check_config_agreed; echo $?) -eq "0" ]; then | ||||||
| 		I_AGREE_MAILINABOX=$(/bin/true) | 		I_AGREE_MAILINABOX="$(/bin/true)" | ||||||
| 	fi | 	fi | ||||||
| 
 | 
 | ||||||
| 	#This is so a user can programmatically agree to our legal notice | 	#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) | 	echo "Mail-in-a-Box Version: " $(git describe) | ||||||
| fi | fi | ||||||
| echo | echo | ||||||
|  | 
 | ||||||
|  | function get_I_AGREE_MAILINABOX(){ | ||||||
|  | 	echo "$I_AGREE_MAILINABOX" | ||||||
|  | } | ||||||
| @ -57,6 +57,9 @@ chmod +x /usr/local/bin/mailinabox | |||||||
| # STORAGE_ROOT. | # STORAGE_ROOT. | ||||||
| source setup/questions.sh | source setup/questions.sh | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | I_AGREE_MAILINABOX=$(check_config_agreed; echo $?) | ||||||
|  | 
 | ||||||
| if [ -z "${I_AGREE_MAILINABOX:-}" ]; then | if [ -z "${I_AGREE_MAILINABOX:-}" ]; then | ||||||
| 	echo "ERROR: You must agree to Mail-in-a-Box's Legal Notice. You can either:" | 	echo "ERROR: You must agree to Mail-in-a-Box's Legal Notice. You can either:" | ||||||
| 	echo "run this in interactive mode; or" | 	echo "run this in interactive mode; or" | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user