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

View file

@ -19,8 +19,18 @@
#
user="$__object_id"
# 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
if su - $user -c "[ -d \"\$HOME/.rvm\" ]" ; then
echo "present"
else
echo "absent"
fi
fi