Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ceacae42
Unverified
Commit
ceacae42
authored
Feb 14, 2018
by
Christoph Blecker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check if netstat or iproute2 is available
parent
1aa2a027
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
etcd.sh
hack/lib/etcd.sh
+11
-2
No files found.
hack/lib/etcd.sh
View file @
ceacae42
...
...
@@ -22,13 +22,22 @@ ETCD_PORT=${ETCD_PORT:-2379}
kube::etcd::validate
()
{
# validate if in path
which
etcd
>
/dev/null
||
{
command
-v
etcd
>
/dev/null
||
{
kube::log::usage
"etcd must be in your PATH"
exit
1
}
# validate etcd port is free
if
netstat
-nat
|
grep
"[
\.
:]
${
ETCD_PORT
:?
}
.*LISTEN"
>
/dev/null 2>&1
;
then
local
port_check_command
if
command
-v
ss &> /dev/null
&&
ss
-Version
|
grep
'iproute2'
&> /dev/null
;
then
port_check_command
=
"ss"
elif
command
-v
netstat &>/dev/null
;
then
port_check_command
=
"netstat"
else
kube::log::usage
"unable to identify if etcd is bound to port
${
ETCD_PORT
}
. unable to find ss or netstat utilities."
exit
1
fi
if
${
port_check_command
}
-nat
|
grep
"LISTEN"
|
grep
"[
\.
:]
${
ETCD_PORT
:?
}
"
>
/dev/null 2>&1
;
then
kube::log::usage
"unable to start etcd as port
${
ETCD_PORT
}
is in use. please stop the process listening on this port and retry."
kube::log::usage
"
`
netstat
-nat
|
grep
"[
\.
:]
${
ETCD_PORT
:?
}
.*LISTEN"
`
"
exit
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment