forked from ungleich-public/cdist
Merge branch '__update_alternatives_with_explorer' into 'master'
__update_alternatives: add state explorer See merge request ungleich-public/cdist!848
This commit is contained in:
commit
44700424ba
2 changed files with 12 additions and 3 deletions
8
cdist/conf/type/__update_alternatives/explorer/state
Executable file
8
cdist/conf/type/__update_alternatives/explorer/state
Executable file
|
@ -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
|
|
@ -17,9 +17,10 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
# Setup alternative - no standard way to create, always set
|
if [ "$(cat "$__object/explorer/state")" = 'present' ]
|
||||||
#
|
then exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
path="$(cat "$__object/parameter/path")"
|
path="$(cat "$__object/parameter/path")"
|
||||||
name="$__object_id"
|
name="$__object_id"
|
||||||
|
|
Loading…
Reference in a new issue