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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Plan de cuques
eole-wol
Commits
78cf7059
Verified
Commit
78cf7059
authored
Aug 2, 2018
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Add some timeouts
parent
23314a35
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
wol/scripts/wakeonlanservice.sh
+8
-0
8 additions, 0 deletions
wol/scripts/wakeonlanservice.sh
wol/www/index.php
+6
-0
6 additions, 0 deletions
wol/www/index.php
with
14 additions
and
0 deletions
wol/scripts/wakeonlanservice.sh
+
8
−
0
View file @
78cf7059
...
...
@@ -24,6 +24,7 @@ getip(){
IP
=
$(
ip a |
awk
'/inet.*containers/ {print $2}'
|
cut
-d
/
-f
1
)
broadcast
=
$(
ip a |
awk
'/inet.*eth1/ {print $4}'
|
cut
-d
/
-f
1
)
subnet
=
$(
ip a |
awk
'/inet.*containers/ {print $2}'
|
cut
-d
/
-f
1 |
cut
-d
.
-f
1-3
)
LIMIT
=
20
while
true
do
MAC
=
`
netcat
-l
$IP
9999
`
...
...
@@ -31,11 +32,18 @@ do
then
wakeonlan
-i
$broadcast
"
$MAC
"
bootedip
=
""
timeout
=
0
sleep
25
while
[
-z
"
$bootedip
"
]
do
bootedip
=
`
getip
$MAC
`
sleep
5
timeout
=
$((
$timeout
+
1
))
if
[
$timeout
-ge
$LIMIT
]
then
$bootedip
=
"ERROR"
break
fi
done
echo
"
$bootedip
"
| netcat
$subnet
.51 9999
fi
...
...
This diff is collapsed.
Click to expand it.
wol/www/index.php
+
6
−
0
View file @
78cf7059
...
...
@@ -41,6 +41,12 @@
data
:
'
<?php
echo
"mac=
$mac
"
?>
'
,
url
:
'
boot.php
'
,
timeout
:
120000
,
error
:
function
(
reponse
){
if
(
textStatus
===
'
timeout
'
)
{
alert
(
'
Erreur : timeout
'
);
}
},
success
:
function
(
response
)
{
$
(
"
#result
"
).
html
(
response
)
;
}
...
...
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