forked from ungleich-public/cdist
only install/deinstall apt packages if necessary
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
c90ae945a8
commit
3a10475151
1 changed files with 8 additions and 4 deletions
|
@ -27,14 +27,18 @@ else
|
|||
name="$__object_id"
|
||||
fi
|
||||
|
||||
state=$(cat "$__object/parameter/state")
|
||||
state="$(cat "$__object/parameter/state")"
|
||||
|
||||
case "$state" in
|
||||
installed)
|
||||
pkg_status="$(cat "$__object/explorer/pkg_status")"
|
||||
if [ "$pkg_status" != "ii" ]; then
|
||||
echo apt-get --quiet --yes install \"$name\"
|
||||
fi
|
||||
;;
|
||||
deinstalled)
|
||||
if [ "$pkg_status" != "un" ]; then
|
||||
echo apt-get --quiet --yes remove \"$name\"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
Loading…
Reference in a new issue