forked from ungleich-public/cdist
use shortcut version to exit if nothing is to be done
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
parent
5eac7512a5
commit
13fc5aa8f5
1 changed files with 12 additions and 10 deletions
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# 2012 Evax Software <contact@evax.fr>
|
# 2012 Evax Software <contact@evax.fr>
|
||||||
|
# 2012 Nico Schottelius (nico-cdist at schottelius.org)
|
||||||
#
|
#
|
||||||
# This file is part of cdist.
|
# This file is part of cdist.
|
||||||
#
|
#
|
||||||
|
@ -25,8 +26,10 @@ gemsetname="$(echo "$gemset" | cut -d '@' -f 2)"
|
||||||
state_is="$(cat "$__object/explorer/state")"
|
state_is="$(cat "$__object/explorer/state")"
|
||||||
user="$(cat "$__object/parameter/user")"
|
user="$(cat "$__object/parameter/user")"
|
||||||
state_should="$(cat "$__object/parameter/state")"
|
state_should="$(cat "$__object/parameter/state")"
|
||||||
if [ "$state_is" != "$state_should" ]; then
|
|
||||||
case "$state_should" in
|
[ "$state_is" = "$state_should" ] && exit 0
|
||||||
|
|
||||||
|
case "$state_should" in
|
||||||
present)
|
present)
|
||||||
cat << DONE
|
cat << DONE
|
||||||
su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\"
|
su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\"
|
||||||
|
@ -39,5 +42,4 @@ su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\"
|
||||||
rvm use $gemset; gem uninstall $gem"
|
rvm use $gemset; gem uninstall $gem"
|
||||||
DONE
|
DONE
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
|
||||||
|
|
Loading…
Reference in a new issue