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 ...@@ -16,13 +16,29 @@ function runasownerof
path=$1 path=$1
precmd= precmd=
shift 1 shift 1
pushd $path > /dev/null
if [ $( stat --format=%u $path ) -ne $UID ] if [ $( stat --format=%u $path ) -ne $UID ]
then then
precmd="sudo -u $( stat --format=%U $path )" precmd="sudo -u $( stat --format=%U $path )"
fi fi
unset path unset path
${precmd} "$@" ${precmd} "$@"
rv=$?
popd > /dev/null
unset precmd 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 set -x
...@@ -39,6 +55,8 @@ then ...@@ -39,6 +55,8 @@ then
runasownerof ${BFAHOME} git pull runasownerof ${BFAHOME} git pull
exec $0 wealreadypulled exec $0 wealreadypulled
else 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 runasownerof ${BFAHOME} npm rebuild
fi 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