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.keep
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Tyagov
slapos.package.keep
Commits
f9cb2f01
Commit
f9cb2f01
authored
May 04, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refine script init-slapos-node.sh
parent
393a4a28
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
12 deletions
+30
-12
windows/scripts/init-slapos-node.sh
windows/scripts/init-slapos-node.sh
+30
-12
No files found.
windows/scripts/init-slapos-node.sh
View file @
f9cb2f01
#! /bin/bash
#
# It used to initialzie slapos node when the computer startup:
#
# 1. Start re6stnet,
#
# 2. Check whether IPv6 connection is availabe
#
# 3. Run slapformat to synchornize information with master
#
# 4. Start slapproxy, it will used by slapos desktop and node manager
#
# 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
"
{C8D7F065-AD35-4777-A768-122451282533}
"
|
\
grep
-B
1
"
$1
"
|
\
grep
"^Connection"
|
\
sed
-e
"s/^Connection Name
\\
s*:
\\
s*//g"
fi
}
cfilename
=
/etc/opt/slapos/slapos.cfg
# Default node configure filename
cfilename
=
${
1
:/etc/opt/slapos/slapos.cfg
}
if
[[
!
-f
$cfilename
]]
;
then
echo
"Error: no found configure file
$cfilename
, the computer "
...
...
@@ -20,31 +36,33 @@ if [[ ! -f $cfilename ]] ; then
exit
1
fi
interface
=
$(
grep
"^interface_name
\\
s*="
$cfilename
|
sed
-e
"s/^interface_name
\\
s*=
\\
s*//g"
)
interface
=
$(
grep
"^interface_name
\\
s*="
$cfilename
|
\
sed
-e
"s/^interface_name
\\
s*=
\\
s*//g"
)
if
((
$?
==
0
))
;
then
ifname
=
$(
guid2name
$interface
)
else
echo
"Error: no interface found in the configure file
$cfilename
"
exit
1
fi
if
[[
"
$ifname
"
==
""
]]
;
then
echo
"Error: no ipv6 interface found in the configure file
$cfilename
"
exit
1
fi
# Run re6stnet, waiting until it works
cd
/etc/re6stnet
re6stnet @re6stnet.conf
-I
$ifname
-i
$ifname
echo
Waiting Re6stent network work ...
echo
"Waiting re6stent network work ..."
while
true
;
do
ping6 slap.vifib.com
>
/dev/null
&&
break
done
echo
"re6stnet network OK."
if
((
$?
==
0
))
;
then
echo
Re6stnet network OK.
else
echo
SlapOS Node initialize failed, no any IPv6 connection.
exit
1
fi
# Run slapformat
/opt/slapos/bin/slapformat
-c
--now
$cfilename
||
\
(
echo
"Error: initialize SlapOS Node failed."
;
exit
1
)
echo
"run slapformat OK."
/opt/slapos/bin/slapformat
-c
--now
/etc/opt/slapos/slapos.cfg
# Run slapproxy
/opt/slapos/bin/slapproxy
||
echo
"Warning: start slapproxy failed"
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