Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nucleo
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blockchain
nucleo
Commits
8fed6328
Commit
8fed6328
authored
6 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
Un bfaupdate.sh mas avanzado
parent
a0af97ef
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/bfaupdate.sh
+38
-4
38 additions, 4 deletions
bin/bfaupdate.sh
with
38 additions
and
4 deletions
bin/bfaupdate.sh
+
38
−
4
View file @
8fed6328
#!/bin/bash
# Robert Martin-Legene <robert@nic.ar>
# 2019
# You can start this as root or not - as long as $BFAHOME is set, it
# should work.
trap
"exit 1"
ERR
if
[
-z
"
${
BFAHOME
}
"
]
;
then
echo
"
\$
BFAHOME not set. Did you source bfa/bin/env ?"
>
&2
;
exit
1
;
fi
source
${
BFAHOME
}
/bin/libbfa.sh
||
exit
1
function
runasownerof
{
path
=
$1
precmd
=
shift
1
if
[
$(
stat
--format
=
%u
$path
)
-ne
$UID
]
then
precmd
=
"sudo -u
$(
stat
--format
=
%U
$path
)
"
fi
unset
path
${
precmd
}
"
$@
"
unset
precmd
}
set
-x
cd
${
BFAHOME
}
sudo
apt
-y
install
libclass-accessor-perl
git pull
npm rebuild
if
[
"
$1
"
=
""
]
then
cd
`
dirname
$0
`
# Pulling may update this script itself.
# We pull an updated repository, including an updated version of
# ourself, and then we execute the updates "us"
# This first part of the if is static. Changes (updates to this
# script) goes after the 'else'
#
# To keep things neat, make sure we pull as the user owning the
# directory.
runasownerof
.
git pull
exec
./
`
basename
$0
`
wealreadypulled
else
cd
${
BFAHOME
}
runasownerof / apt
-y
install
libclass-accessor-perl
runasownerof
.
npm rebuild
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment