forked from ungleich-public/cdist
fix type __file: md5sum from stdin (=same name) and prepend / to object_id
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
3ff0b4a393
commit
1d133ecb0a
2 changed files with 4 additions and 4 deletions
|
@ -24,12 +24,12 @@
|
||||||
if [ -f "$__object/parameter/destination" ]; then
|
if [ -f "$__object/parameter/destination" ]; then
|
||||||
destination="$(cat "$__object/parameter/destination")"
|
destination="$(cat "$__object/parameter/destination")"
|
||||||
else
|
else
|
||||||
destination="$__object_id"
|
destination="/$__object_id"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# No output if file does not exist - does definitely not match the md5sum :-)
|
# No output if file does not exist - does definitely not match the md5sum :-)
|
||||||
if [ -e "$destination" ]; then
|
if [ -e "$destination" ]; then
|
||||||
md5sum "$destination"
|
md5sum < "$destination"
|
||||||
else
|
else
|
||||||
echo "NO FILE NOT FOUND, NO CHECKSUM CALCULATED."
|
echo "NO FILE FOUND, NO CHECKSUM CALCULATED."
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -49,7 +49,7 @@ if [ -f "$__object/parameter/source" ]; then
|
||||||
exec 1>&2
|
exec 1>&2
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
md5sum="$(md5sum "$source")"
|
md5sum="$(md5sum < "$source")"
|
||||||
remote_md5sum="$(cat "$__object/explorer/md5sum")"
|
remote_md5sum="$(cat "$__object/explorer/md5sum")"
|
||||||
|
|
||||||
# Is md5sum the right approach?
|
# Is md5sum the right approach?
|
||||||
|
|
Loading…
Reference in a new issue