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
582cdb32
Verified
Commit
582cdb32
authored
Jun 13, 2019
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Improved upgrade_all loging for
primtux-eole#25
parent
e4eec971
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
+34
-6
34 additions, 6 deletions
registry/scripts/upgrade_all.sh
with
34 additions
and
6 deletions
registry/scripts/upgrade_all.sh
+
34
−
6
View file @
582cdb32
...
...
@@ -46,13 +46,21 @@ wait_time=120
wait_step
=
5
cmd
=
"cd /opt/primtux-eole/; export HTTPS_PROXY='http://dnsproxy:3128'; git pull; ./upgrade-session.sh
$1
"
declare
-A
HOSTS
declare
-A
IPTOMACS
declare
-A
DOWNS
while
read date
mac name
do
# Boot machine
log
"Trying to boot
$mac
"
if
[
!
-z
"
$date
"
]
then
HOSTS[
$mac
]=
$name
log
"Trying to boot
$name
(
$mac
)"
wakeonlan
-i
$broadcast
"
$mac
"
sleep
5
MACS+
=
"
$mac
"
fi
done
<
$conf_file
# Wait for boot
...
...
@@ -65,10 +73,12 @@ do
done
log
-e
"
\n
Waiting finished"
# Running command
for
mac
in
$MACS
do
for
ip
in
$(
getips
$mac
)
do
IPTOMACS[
$ip
]=
$mac
runcmd
$ip
$cmd
&
PIDS
=
"
$PIDS
$!
"
done
...
...
@@ -82,9 +92,27 @@ done
# Retrieving logs
for
f
in
/tmp/
$$
-
*
do
host
=
$(
echo
$f
|
cut
-d
'-'
-f
2-
)
log
"===== Begin host
$host
===="
ip
=
$(
echo
$f
|
cut
-d
'-'
-f
2- |
sed
's/\.log$//'
)
mac
=
${
IPTOMACS
[
$ip
]
}
name
=
${
HOSTS
[
$mac
]
}
log
"===== Begin host
$name
(
$mac
-
$ip
) ===="
cat
$f
>>
$mainlog
log
"===== End host
$host
===="
log
"===== End host
$name
===="
if
[
$(
wc
-l
$f
|
awk
'{print $1}'
)
-gt
0
]
then
DOWNS[
$mac
]=
$name
fi
done
# Listing down hosts
if
[
${#
DOWNS
[@]
}
-eq
0
]
then
log
"All
${#
HOSTS
[@]
}
hosts answered"
else
log
"On a total of
${#
HOSTS
[@]
}
hosts,
${#
DOWNS
[@]
}
are still down:"
for
mac
in
${
!DOWNS[@]
}
do
log
-e
"
\t
*
${
DOWNS
[
$mac
]
}
(
$mac
)"
done
fi
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