support root and user rvm

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
Nico Schottelius 2012-10-02 18:05:47 +02:00
parent 07902f2a0b
commit 62c69c63b5
1 changed files with 13 additions and 3 deletions

View File

@ -19,8 +19,18 @@
#
user="$__object_id"
if su - $user -c "[ -d \"\$HOME/.rvm\" ]" ; then
echo "present"
# RVM behaves differently if root is the username / uid == 0
if [ "$user" = "root" ]; then
if [ -d /usr/local/rvm ]; then
echo present
else
echo absent
fi
else
echo "absent"
if su - $user -c "[ -d \"\$HOME/.rvm\" ]" ; then
echo "present"
else
echo "absent"
fi
fi