cdist/cdist/conf/type/__rsync/gencode-remote
Nico Schottelius 0ddc848b1e add missing leading / to destination in case object_id is taken
Signed-off-by: Nico Schottelius <nico@freiheit.schottelius.org>
2015-02-12 16:21:15 +01:00

17 lines
437 B
Text

if [ -f "$__object/parameter/destination" ]; then
destination=$(cat "$__object/parameter/destination")
else
destination="/$__object_id"
fi
ownergroup=""
if [ -f "$__object/parameter/owner" ]; then
ownergroup=$(cat "$__object/parameter/owner")
fi
if [ -f "$__object/parameter/group" ]; then
ownergroup=":$(cat "$__object/parameter/group")"
fi
if [ "$ownergroup" ]; then
echo chown -R "$ownergroup" "$destination"
fi