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
da376b5f
Verified
Commit
da376b5f
authored
Aug 5, 2019
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Transmit file in one netcat
parent
909b75ee
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/get_registry.sh
+4
-9
4 additions, 9 deletions
wol/scripts/get_registry.sh
wol/scripts/wakeonlanservice.sh
+1
-6
1 addition, 6 deletions
wol/scripts/wakeonlanservice.sh
with
5 additions
and
15 deletions
wol/scripts/get_registry.sh
100644 → 100755
+
4
−
9
View file @
da376b5f
...
@@ -17,18 +17,13 @@
...
@@ -17,18 +17,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
IP
=
$(
ip a |
awk
'/inet.*containers/ {print $2}'
|
cut
-d
/
-f
1
)
IP
=
$(
ip a |
awk
'/inet.*containers/ {print $2}'
|
cut
-d
/
-f
1
)
netcat
=
"netcat -l
$IP
9999"
port
=
9999
netcat
=
"netcat -l
$IP
$port
"
KPID
=
`
ps aux |
grep
"
$netcat
"
|
awk
'{print $2}'
`
KPID
=
`
ps aux |
grep
"
$netcat
"
|
awk
'{print $2}'
`
[
!
-z
"
$KPID
"
]
&&
kill
$KPID
[
!
-z
"
$KPID
"
]
&&
kill
$KPID
>
/dev/null 2>&1
subnet
=
$(
ip a |
awk
'/inet.*containers/ {print $2}'
|
cut
-d
/
-f
1 |
cut
-d
.
-f
1-3
)
subnet
=
$(
ip a |
awk
'/inet.*containers/ {print $2}'
|
cut
-d
/
-f
1 |
cut
-d
.
-f
1-3
)
host
=
$subnet
.52
host
=
$subnet
.52
port
=
9999
echo
"get_registry"
| netcat
$host
$port
echo
"get_registry"
| netcat
$host
$port
nline
=
$(
$netcat
|
cut
-d
' '
-f
1
)
stdbuf
-i0
$netcat
i
=
0
;
for
i
in
$(
seq
1
$nline
)
do
$netcat
done
This diff is collapsed.
Click to expand it.
wol/scripts/wakeonlanservice.sh
+
1
−
6
View file @
da376b5f
...
@@ -47,11 +47,6 @@ do
...
@@ -47,11 +47,6 @@ do
done
done
elif
[
$MAC
==
"get_registry"
]
elif
[
$MAC
==
"get_registry"
]
then
then
hostfile
=
"/etc/registry/hosts"
stdbuf
-oL
cat
/etc/registry/hosts | netcat
$host
$port
wc
-l
$hostfile
| netcat
$host
$port
while
read
line
do
echo
"
$line
"
| netcat
$host
$port
done
<
$hostfile
fi
fi
done
done
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