forked from ungleich-public/cdist
__file: notify when doing changes
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
parent
61747c4cb7
commit
7a41d6d8fa
2 changed files with 5 additions and 0 deletions
|
@ -41,6 +41,7 @@ if [ "$state_should" = "present" -o "$state_should" = "exists" ]; then
|
||||||
|
|
||||||
if [ "$local_cksum" != "$remote_cksum" ]; then
|
if [ "$local_cksum" != "$remote_cksum" ]; then
|
||||||
echo "$__remote_copy" "$source" "${__target_host}:${destination}"
|
echo "$__remote_copy" "$source" "${__target_host}:${destination}"
|
||||||
|
echo "copy" >> "$__object/notifications"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Source \"$source\" does not exist." >&2
|
echo "Source \"$source\" does not exist." >&2
|
||||||
|
|
|
@ -38,17 +38,20 @@ case "$state_should" in
|
||||||
# Group
|
# Group
|
||||||
if [ -f "$__object/parameter/group" ]; then
|
if [ -f "$__object/parameter/group" ]; then
|
||||||
echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\"
|
echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\"
|
||||||
|
echo "chgrp" >> "$__object/notifications"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Owner
|
# Owner
|
||||||
if [ -f "$__object/parameter/owner" ]; then
|
if [ -f "$__object/parameter/owner" ]; then
|
||||||
echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\"
|
echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\"
|
||||||
|
echo "chown" >> "$__object/notifications"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Mode - needs to happen last as a chown/chgrp can alter mode by
|
# Mode - needs to happen last as a chown/chgrp can alter mode by
|
||||||
# clearing S_ISUID and S_ISGID bits (see chown(2))
|
# clearing S_ISUID and S_ISGID bits (see chown(2))
|
||||||
if [ -f "$__object/parameter/mode" ]; then
|
if [ -f "$__object/parameter/mode" ]; then
|
||||||
echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\"
|
echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\"
|
||||||
|
echo "chmod" >> "$__object/notifications"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -56,6 +59,7 @@ case "$state_should" in
|
||||||
|
|
||||||
if [ "$exists" = "yes" ]; then
|
if [ "$exists" = "yes" ]; then
|
||||||
echo rm -f \"$destination\"
|
echo rm -f \"$destination\"
|
||||||
|
echo "removal" >> "$__object/notifications"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue