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
e68f6698
Verified
Commit
e68f6698
authored
6 years ago
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Async boot with output on the flow
parent
6a91ed84
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
wol/scripts/sendmac.sh
+4
-1
4 additions, 1 deletion
wol/scripts/sendmac.sh
wol/scripts/wakeonlanservice.sh
+6
-1
6 additions, 1 deletion
wol/scripts/wakeonlanservice.sh
wol/www/index.php
+17
-1
17 additions, 1 deletion
wol/www/index.php
with
27 additions
and
3 deletions
wol/scripts/sendmac.sh
+
4
−
1
View file @
e68f6698
...
...
@@ -18,5 +18,8 @@
IP
=
$(
ip a |
awk
'/inet.*containers/ {print $2}'
|
cut
-d
/
-f
1
)
subnet
=
$(
ip a |
awk
'/inet.*containers/ {print $2}'
|
cut
-d
/
-f
1 |
cut
-d
.
-f
1-3
)
echo
"Demande de démarrage pour l'adresse mac :
$1
"
echo
"
$1
"
| netcat
$subnet
.52 9999
netcat
-l
$IP
9999
echo
"Démarrage en cours, attente de l'IP"
retip
=
`
netcat
-l
$IP
9999
`
echo
"Vous pouvez désormais lancer XRDP et vous connecter à l'adresse :
$retip
"
This diff is collapsed.
Click to expand it.
wol/scripts/wakeonlanservice.sh
+
6
−
1
View file @
e68f6698
...
...
@@ -30,8 +30,13 @@ netcat -k -l $IP 9999 | \
if
[
$(
echo
"
$MAC
"
| egrep
-c
"^([0-9a-f]{2}:?){6}$"
)
-eq
1
]
then
wakeonlan
-i
$broadcast
"
$MAC
"
$bootedip
=
""
sleep
30
while
[
-z
"
$bootedip
"
]
do
bootedip
=
`
getip
$MAC
`
sleep
5
done
echo
"
$bootedip
"
| netcat
$subnet
.51 9999
fi
done
...
...
This diff is collapsed.
Click to expand it.
wol/www/index.php
+
17
−
1
View file @
e68f6698
...
...
@@ -32,7 +32,23 @@
if
(
strcmp
(
$cmd
,
""
)){
//echo "<p>execution de ' $cmd $args '</p>";
//echo "<p>".shell_exec("$cmd $args")."</p>";
echo
"<p> Vous pouvez ouvrir XRDP et vous connecter à l'IP : <code>"
.
shell_exec
(
"
$cmd
$args
"
)
.
"</code></p>"
;
echo
"<p> Demarrage de la machine "
.
$args
.
"</p>"
;
echo
"<pre><code>"
;
$descriptorspec
=
array
(
0
=>
array
(
"pipe"
,
"r"
),
// stdin is a pipe that the child will read from
1
=>
array
(
"pipe"
,
"w"
),
// stdout is a pipe that the child will write to
2
=>
array
(
"pipe"
,
"w"
)
// stderr is a pipe that the child will write to
);
flush
();
$process
=
proc_open
(
"
$cmd
$args
"
,
$descriptorspec
,
$pipes
,
realpath
(
'./'
),
array
());
echo
"<pre>"
;
if
(
is_resource
(
$process
))
{
while
(
$s
=
fgets
(
$pipes
[
1
]))
{
print
$s
;
flush
();
}
}
echo
"</code></pre>"
;
}
?>
<div
id=
"box"
>
...
...
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