Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
eole-wol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
primtux-eole
Grenoble
eole-wol
Commits
f23054ce
Verified
Commit
f23054ce
authored
Apr 26, 2019
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Rapport unifies de mise à jour, fix
#8
parent
bbc612f1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
registry/scripts/upgrade_all.sh
+23
-5
23 additions, 5 deletions
registry/scripts/upgrade_all.sh
with
23 additions
and
5 deletions
registry/scripts/upgrade_all.sh
+
23
−
5
View file @
f23054ce
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
mainlog
=
"/var/log/
`
basename
$0
`
_
`
date
+%Y%m%d-%H%M
`
"
getip
(){
getip
(){
awk
'/^lease/{IP=$2} /hardware ethernet/{gsub(";","",$3);if($3 == "'
$1
'"){print IP}}'
\
awk
'/^lease/{IP=$2} /hardware ethernet/{gsub(";","",$3);if($3 == "'
$1
'"){print IP}}'
\
< /var/lib/dhcp/dhcpd.leases |
tail
-n
1
< /var/lib/dhcp/dhcpd.leases |
tail
-n
1
...
@@ -23,9 +25,14 @@ getip(){
...
@@ -23,9 +25,14 @@ getip(){
runcmd
(){
runcmd
(){
host
=
$1
host
=
$1
logfile
=
/tmp/
$$
-
$host
.log
shift
shift
echo
"Runnig
$@
on
$host
"
echo
"Runnig
$@
on
$host
"
|
tee
$logfile
ssh
-o
StrictHostKeychecking
=
no root@
$host
$@
ssh
-o
StrictHostKeychecking
=
no root@
$host
$@
|
tee
$logfile
}
log
(){
echo
$@
|
tee
-a
$mainlog
}
}
# Switch to lametros repository
# Switch to lametros repository
...
@@ -43,19 +50,20 @@ cmd="cd /opt/primtux-eole/; export HTTPS_PROXY='http://dnsproxy:3128'; git pull;
...
@@ -43,19 +50,20 @@ cmd="cd /opt/primtux-eole/; export HTTPS_PROXY='http://dnsproxy:3128'; git pull;
while
read date
mac name
while
read date
mac name
do
do
# Boot machine
# Boot machine
log
"Trying to boot
$mac
"
wakeonlan
-i
$broadcast
"
$mac
"
wakeonlan
-i
$broadcast
"
$mac
"
MACS+
=
"
$mac
"
MACS+
=
"
$mac
"
done
<
$conf_file
done
<
$conf_file
# Wait for boot
# Wait for boot
echo
"
"
log
"Wakeonlan sent, waiting
"
while
[
$wait_time
-gt
0
]
while
[
$wait_time
-gt
0
]
do
do
echo
-ne
"Waiting for boot, remaining
$wait_time
seconds
\r
"
log
-ne
"Waiting for boot, remaining
$wait_time
seconds
\r
"
|
tee
$mainlog
sleep
$wait_step
sleep
$wait_step
wait_time
=
$((
$wait_time
-
$wait_step
))
wait_time
=
$((
$wait_time
-
$wait_step
))
done
done
echo
-e
"
\n
Waiting finished"
log
-e
"
\n
Waiting finished"
for
mac
in
$MACS
for
mac
in
$MACS
do
do
...
@@ -65,3 +73,13 @@ do
...
@@ -65,3 +73,13 @@ do
done
done
# wait all pids
# wait all pids
wait
$PIDS
wait
$PIDS
# Retrieving logs
for
f
in
/tmp/
$$
-
*
do
host
=
$(
echo
$f
|
cut
-d
'-'
-f
2-
)
log
"===== Begin host
$host
===="
cat
$f
>>
$mainlog
log
"===== End host
$host
===="
done
log
"Output written to
$mainlog
"
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