Browse Source

__update_alternatives: add state explorer

merge-requests/848/head
ander 3 years ago
parent
commit
b891bb05d5
  1. 8
      cdist/conf/type/__update_alternatives/explorer/state
  2. 4
      cdist/conf/type/__update_alternatives/gencode-remote

8
cdist/conf/type/__update_alternatives/explorer/state vendored

@ -0,0 +1,8 @@
#!/bin/sh -e
path="$(cat "$__object/parameter/path")"
name="$__object_id"
link="$(readlink "/etc/alternatives/$name")"
if [ "$path" = "$link" ]
then echo present
else echo absent
fi

4
cdist/conf/type/__update_alternatives/gencode-remote vendored

@ -21,6 +21,10 @@
# Setup alternative - no standard way to create, always set
#
if [ "$(cat "$__object/explorer/state")" = 'present' ]
then exit 0
fi
path="$(cat "$__object/parameter/path")"
name="$__object_id"
echo "update-alternatives --quiet --set '$name' '$path'"

Loading…
Cancel
Save