Skip to content
Snippets Groups Projects
Commit 15f24023 authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

Instalar solamente paquetes si no estan. runasownerof ahora hace "cd" tambien.

parent 49e3eee1
No related branches found
No related tags found
No related merge requests found
......@@ -16,13 +16,29 @@ function runasownerof
path=$1
precmd=
shift 1
pushd $path > /dev/null
if [ $( stat --format=%u $path ) -ne $UID ]
then
precmd="sudo -u $( stat --format=%U $path )"
fi
unset path
${precmd} "$@"
rv=$?
popd > /dev/null
unset precmd
return $rv
}
function aptinstall
{
for pkg in $*
do
dpkg --verify $pkg 2>/dev/null ||
(
info "Installing $pkg"
runasownerof / apt -y install $pkg
)
done
}
set -x
......@@ -39,6 +55,8 @@ then
runasownerof ${BFAHOME} git pull
exec $0 wealreadypulled
else
runasownerof / apt -y install libclass-accessor-perl
aptinstall libclass-accessor-perl
# make sure bfa is in group sudo
id bfa | grep -q sudo || runasownerof / adduser bfa sudo
runasownerof ${BFAHOME} npm rebuild
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment