mirror of
				https://github.com/zokradonh/kopano-docker
				synced 2025-10-31 02:17:47 +00:00 
			
		
		
		
	define exit trap after checking for reg (#235)
otherwise script would print an undefined variable for tmpfile Signed-off-by: Felix Bartels <felix@host-consultants.de>
This commit is contained in:
		
							parent
							
								
									1d3093680d
								
							
						
					
					
						commit
						da43a5abbf
					
				| @ -3,13 +3,6 @@ | |||||||
| set -euo pipefail | set -euo pipefail | ||||||
| IFS=$'\n\t' | IFS=$'\n\t' | ||||||
| 
 | 
 | ||||||
| function finish { |  | ||||||
| 	if [ -e "$tmpfile" ]; then |  | ||||||
| 		rm "$tmpfile" |  | ||||||
| 	fi |  | ||||||
| } |  | ||||||
| trap finish EXIT |  | ||||||
| 
 |  | ||||||
| if ! command -v reg > /dev/null; then | if ! command -v reg > /dev/null; then | ||||||
| 	echo "Please install reg in order to run this script." | 	echo "Please install reg in order to run this script." | ||||||
| 	exit 1 | 	exit 1 | ||||||
| @ -20,6 +13,13 @@ if [ ! -e ./.env ]; then | |||||||
| 	exit 1 | 	exit 1 | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
|  | function finish { | ||||||
|  | 	if [ -e "$tmpfile" ]; then | ||||||
|  | 		rm "$tmpfile" | ||||||
|  | 	fi | ||||||
|  | } | ||||||
|  | trap finish EXIT | ||||||
|  | 
 | ||||||
| # this is a kind of ugly hack to be able to source the env file | # this is a kind of ugly hack to be able to source the env file | ||||||
| # this is sadly needed since postfix in https://github.com/tomav/docker-mailserver/ cannot deal with quoted values | # this is sadly needed since postfix in https://github.com/tomav/docker-mailserver/ cannot deal with quoted values | ||||||
| tmpfile=$(mktemp /tmp/kopano-docker-env.XXXXXX) | tmpfile=$(mktemp /tmp/kopano-docker-env.XXXXXX) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user