Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
slapos.package
Commits
b871fc4b
Commit
b871fc4b
authored
May 08, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add script to check network configuration consistency.
parent
683ae427
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
0 deletions
+92
-0
windows/scripts/check_network.sh
windows/scripts/check_network.sh
+92
-0
No files found.
windows/scripts/check_network.sh
0 → 100755
View file @
b871fc4b
#! /bin/bash
#
# It used to check the following network setting
#
# 1. Support IPv6 or not.
#
# 2. Is there network connection re6stnet-lo or not.
#
# 3. Make sure only one MSLOOP network adapter.
#
# 4. interface_name in the Node configure file is re6stnet-lo
#
function
usage
()
{
echo
Check network setting, usage:
echo
echo
check_network.sh
[
node_config_file]
echo
echo
The default node config file is /etc/opt/slapos/slapos.cfg
echo
}
# Get connection name by GUID name, for example
#
# $ guid2name {C8D7F065-AD35-4777-A768-122451282533}
#
function
guid2name
()
{
if
[[
"
$1
"
==
""
]]
;
then
echo
else
netsh interface ipv6 show interface
level
=
verbose |
\
grep
-B
1
"
$1
"
|
\
grep
"^Connection"
|
\
sed
-e
"s/^Connection Name
\\
s*:
\\
s*//g"
fi
}
# Default node configure filename
node_config_file
=
${
1
-/etc/opt/slapos/slapos.cfg
}
echo
echo
"Checking IPv6 stack ..."
netsh interface ipv6 show interface
>
/dev/null
if
((
$?
))
;
then
echo
"Warning: No IPv6 installed."
echo
"Check IPv6 stack failed."
else
echo
"Check IPv6 stack OK."
fi
echo
echo
echo
"Checking
$node_config_file
..."
if
[[
-f
$node_config_file
]]
;
then
echo
"Check node configure file OK."
echo
echo
"Checking interface_name ..."
interface
=
$(
grep
"^interface_name
\\
s*="
$node_config_file
|
\
sed
-e
"s/^interface_name
\\
s*=
\\
s*//g"
)
if
((
$?
==
0
))
;
then
ifname
=
$(
guid2name
$interface
)
if
[[
"
$ifname
"
==
""
]]
;
then
echo
"Warning: no interface
$interface
found in your computer."
echo
"Check interface name failed."
elif
[[
"
$ifname
"
==
"re6stnet-lo"
]]
;
then
echo
"Check interface name OK."
else
echo
"Warning: connection name of
$interface
is
$ifname
, "
\
"expect it is re6stnet-lo."
echo
"Check interface name failed."
fi
else
echo
"Warning: no interface_name found in the
$node_config_file
"
echo
"Check interface name failed."
fi
echo
else
echo
"Warning:
$node_config_file
doesn't exists."
echo
"Check node configure file failed."
fi
echo
echo
echo
"Checking duplicate MSLOOP network adapter ..."
local
-i
n
=
$(
getmac /V /FO LIST |
grep
"Network Adapter: Microsoft Loopback Adapter"
|
wc
-l
)
((
n
>
1
))
&&
echo
"More than one MSLOOP network adapter found. Be ware all of them share one same MAC Address, thus same IPv6 link address!"
echo
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