adjust grep string
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
aedbc263d7
commit
0b7024a2cc
1 changed files with 7 additions and 2 deletions
|
@ -29,15 +29,20 @@ fi
|
||||||
|
|
||||||
state="$(cat "$__object/parameter/state")"
|
state="$(cat "$__object/parameter/state")"
|
||||||
|
|
||||||
|
cat "$__object/explorer/pkg_version"
|
||||||
|
|
||||||
opts="--assumeyes --quiet"
|
opts="--assumeyes --quiet"
|
||||||
|
|
||||||
|
not_installed="^no package provides"
|
||||||
|
|
||||||
case "$state" in
|
case "$state" in
|
||||||
installed)
|
installed)
|
||||||
if grep -q "is not installed\$" "$__object/explorer/pkg_version"; then
|
if grep -q "$not_installed" "$__object/explorer/pkg_version"; then
|
||||||
echo yum $opts install \"$name\"
|
echo yum $opts install \"$name\"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
uninstalled)
|
uninstalled)
|
||||||
if ! grep -q "is not installed\$" "$__object/explorer/pkg_version"; then
|
if ! grep -q "$not_installed" "$__object/explorer/pkg_version"; then
|
||||||
echo yum $opts remove \"$name\"
|
echo yum $opts remove \"$name\"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue