forked from ungleich-public/cdist
		
	Fixed generated code and explorer
Generated code needed subshell escaped Explorer wasn't parsing output of cksum properly
This commit is contained in:
		
					parent
					
						
							
								a2e96ac435
							
						
					
				
			
			
				commit
				
					
						205f32c78b
					
				
			
		
					 2 changed files with 7 additions and 8 deletions
				
			
		|  | @ -33,7 +33,7 @@ TMP="$(grep '^pf_rules=' ${RC} | cut -d= -f2 | sed 's/"//g')" | ||||||
| PFCONF="${TMP:-"/etc/pf.conf"}" | PFCONF="${TMP:-"/etc/pf.conf"}" | ||||||
| 
 | 
 | ||||||
| if [ -f "${PFCONF}" ]; then	# The pf config file exists, find its cksum. | if [ -f "${PFCONF}" ]; then	# The pf config file exists, find its cksum. | ||||||
| 	cksum -o 1 ${PFCONF} | cut -d= -f2 | sed 's/ //g' | 	cksum -o 1 ${PFCONF} | cut -d= -f2 | awk '{print $1}' | ||||||
| else	# the pf config file doesn't exist | else	# the pf config file doesn't exist | ||||||
| 	echo NOTEXIST | 	echo NOTEXIST | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | @ -45,13 +45,13 @@ cksum=$(cat "$__object/explorer/cksum") | ||||||
| cat <<EOF | cat <<EOF | ||||||
| case $uname in | case $uname in | ||||||
|    Darwin) |    Darwin) | ||||||
|       currentSum=$(cksum -o 1 ${source} | cut '-d ' -f1) |       currentSum=\$(cksum -o 1 ${source} | cut '-d ' -f1) | ||||||
|       ;; |       ;; | ||||||
|    Linux) |    Linux) | ||||||
|       currentSum=$(cksum ${source} | cut '-d ' -f1) |       currentSum=\$(cksum ${source} | cut '-d ' -f1) | ||||||
|       ;; |       ;; | ||||||
|    FreeBSD) |    FreeBSD) | ||||||
|       currentSum=$(cksum -o 1 ${source} | cut -d= -f2 | sed 's/ //g') |       currentSum=\$(cksum -o 1 ${source} | cut -d= -f2 | sed 's/ //g') | ||||||
|       ;; |       ;; | ||||||
|    *) |    *) | ||||||
|       echo "Sorry, I do not know how to find a cksum on ${UNAME}." >&2 |       echo "Sorry, I do not know how to find a cksum on ${UNAME}." >&2 | ||||||
|  | @ -66,9 +66,8 @@ if [ ! "${cksum}" = "NOTEXIST" ]; then | ||||||
| else # File just doesn't exist yet | else # File just doesn't exist yet | ||||||
|    $__remote_copy "${source}" "$__target_host:${rcvar}.new" |    $__remote_copy "${source}" "$__target_host:${rcvar}.new" | ||||||
| fi | fi | ||||||
| 
 |  | ||||||
| if [ -n "${testscript}" ]; then |  | ||||||
|    $__remote_copy "${testscript}" "$__target_host:${rcvar}.test" |  | ||||||
| fi |  | ||||||
| EOF | EOF | ||||||
| 
 | 
 | ||||||
|  | # Debug | ||||||
|  | #exec +x | ||||||
|  | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue