use grep's -q option

This commit is contained in:
Evax Software 2012-01-16 12:29:51 +01:00
parent 34fa123ed1
commit eb83190efd
3 changed files with 6 additions and 6 deletions

View file

@ -28,10 +28,10 @@ if su - $user -c "[ ! -d \"\$HOME/.rvm\" ]" ; then
exit 0
fi
if su - $user -c "source \"\$HOME/.rvm/scripts/rvm\"
rvm list | grep $ruby > /dev/null"; then
rvm list | grep -q $ruby"; then
if su - $user -c "source \"\$HOME/.rvm/scripts/rvm\"
rvm use $ruby > /dev/null; rvm gemset list | grep $gemsetname > /dev/null &&
rvm use $gemset > /dev/null && gem list | grep $gem > /dev/null"; then
rvm use $ruby > /dev/null; rvm gemset list | grep -q $gemsetname &&
rvm use $gemset > /dev/null && gem list | grep -q $gem"; then
echo "installed"
exit 0
fi

View file

@ -27,9 +27,9 @@ if su - $user -c "[ ! -d \"\$HOME/.rvm\" ]" ; then
exit 0
fi
if su - $user -c "source \"\$HOME/.rvm/scripts/rvm\"
rvm list | grep $ruby > /dev/null"; then
rvm list | grep -q $ruby"; then
if su - $user -c "source \"\$HOME/.rvm/scripts/rvm\"
rvm use $ruby > /dev/null; rvm gemset list | grep $gemsetname > /dev/null"; then
rvm use $ruby > /dev/null; rvm gemset list | grep -q $gemsetname"; then
echo "installed"
exit 0
fi

View file

@ -25,7 +25,7 @@ if su - $user -c "[ ! -d \"\$HOME/.rvm\" ]" ; then
exit 0
fi
if su - $user -c "source \"\$HOME/.rvm/scripts/rvm\"
rvm list | grep $ruby >/dev/null"; then
rvm list | grep -q $ruby"; then
echo "installed"
else
echo "removed"