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
Douglas
slapos.package
Commits
23a7d2a2
Commit
23a7d2a2
authored
May 07, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let user press any key to exit after configure node or client
parent
a3ca8db5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
14 deletions
+52
-14
windows/scripts/slapos-all-in-one.iss
windows/scripts/slapos-all-in-one.iss
+1
-1
windows/scripts/slapos-client-config.sh
windows/scripts/slapos-client-config.sh
+19
-4
windows/scripts/slapos-node-config.sh
windows/scripts/slapos-node-config.sh
+31
-8
windows/scripts/slapos.iss
windows/scripts/slapos.iss
+1
-1
No files found.
windows/scripts/slapos-all-in-one.iss
View file @
23a7d2a2
...
...
@@ -77,7 +77,7 @@ Name: "{group}\SlapOS"; Filename: "{app}\cygwin\etc\slapos\desktop\index.html";
Name: "{group}\Node Manager"; Filename: "{app}\cygwin\etc\slapos\node\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\node"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\Configure Client"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/slapos-client-config.sh"; WorkingDir: "{app}\cygwin\etc\slapos\scripts"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\Configure Node"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/slapos-node-config.sh"; WorkingDir: "{app}\cygwin\etc\slapos\scripts"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i
/opt/slapos/bin/slapconsole /etc/opt/slapos/slapos.cfg
"; WorkingDir: "{app}\cygwin\etc\slapos\scripts"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i
-c ""/opt/slapos/bin/slapconsole /etc/opt/slapos/slapos.cfg""
"; WorkingDir: "{app}\cygwin\etc\slapos\scripts"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Update Center"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/build-slapos.sh"; WorkingDir: "{app}\cygwin\etc\slapos\scripts"; IconFilename: "{app}\cygwin\etc\slapos\images\updater.ico";
Name: "{group}\User Guide"; Filename: "{app}\user-guide.html";
Name: "{group}\Read Me"; Filename: "{app}\Readme.txt";
...
...
windows/scripts/slapos-client-config.sh
View file @
23a7d2a2
...
...
@@ -4,9 +4,20 @@
#
# Usage:
#
# ./slapos-client-config
# ./slapos-client-config
certificate_file key_file
#
#
# Show error message and waiting for user to press any key quit
#
function
show_error_exit
()
{
msg
=
${
1
-Configure node failed.
}
echo
$msg
read
-n
1
-t
15
-p
"Press any key to exit..."
exit
1
}
slapos_client_home
=
~/.slapos
client_configure_file
=
$slapos_client_home
/slapos.cfg
client_certificate_file
=
$slapos_client_home
/certificate
...
...
@@ -32,7 +43,7 @@ if [[ -f "$1" ]] ; then
elif
[[
!
-f
$client_certificate_file
]]
;
then
read
-p
"Where is certificate file: "
certificate_file
[[
!
-f
"
$certificate_file
"
]]
&&
\
echo
"Certificate file
$certificate_file
doesn't exists."
&&
exit
1
show_error_exit
"Certificate file
$certificate_file
doesn't exists."
echo
"Copy certificate from
$certificate_file
to
$client_certificate_file
"
cp
$certificate_file
$client_certificate_file
fi
...
...
@@ -43,7 +54,7 @@ if [[ -f "$2" ]] ; then
elif
[[
!
-f
$client_key_file
]]
;
then
read
-p
"Where is key file: "
key_file
[[
!
-f
"
$key_file
"
]]
&&
\
echo
"Key file
$key_file
doesn't exists."
&&
exit
1
show_error_exit
"Key file
$key_file
doesn't exists."
echo
"Copy key from
$key_file
to
$client_key_file
"
cp
$key_file
$client_key_file
fi
...
...
@@ -51,10 +62,14 @@ fi
if
[[
!
-f
$client_configure_file
]]
;
then
[[
-f
$template_configure_file
]]
||
\
(
cd
/etc/slapos
;
wget http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/slapos-client.cfg.example
)
||
\
(
echo
"Download slapos-client.cfg.example failed."
;
exit
1
)
show_error_exit
"Download slapos-client.cfg.example failed."
cp
$template_configure_file
$client_configure_file
fi
sed
-i
-e
"s%^cert_file.*
$%
cert_file =
$client_certificate_file
%"
\
-e
"s%^key_file.*
$%
key_file =
$client_key_file
%"
\
$client_configure_file
echo
SlapOS Client configure successfully.
read
-n
-t
10
-p
"Press any key to exit..."
exit
0
windows/scripts/slapos-node-config.sh
View file @
23a7d2a2
...
...
@@ -77,6 +77,17 @@ function connection2guid()
sed
-e
"s/^GUID
\s
*:
\s
*//"
}
#
# Show error message and waiting for user to press any key quit
#
function
show_error_exit
()
{
msg
=
${
1
-Configure node failed.
}
echo
$msg
read
-n
1
-t
15
-p
"Press any key to exit..."
exit
1
}
node_certificate_file
=
/etc/opt/slapos/ssl/computer.crt
node_key_file
=
/etc/opt/slapos/ssl/computer.key
node_config_file
=
/etc/opt/slapos/slapos.cfg
...
...
@@ -98,8 +109,7 @@ if [[ ! " $original_connections " == *[\ ]$slapos_ifname[\ ]* ]] ; then
devcon
install
$WINDIR
\\
inf
\\
netloop.inf
*
MSLOOP
connection_name
=
$(
get_new_connection
$original_connections
)
[[
"X
$connection_name
"
==
"X"
]]
&&
\
echo
"Add msloop network adapter failed."
&&
\
exit
1
show_error_exit
"Add msloop network adapter failed."
echo
netsh interface
set
interface
name
=
"
$connection_name
"
newname
=
"
$slapos_ifname
"
fi
...
...
@@ -128,7 +138,7 @@ else
read
-p
"computer id: "
computer_id
fi
[[
"
$computer_id
"
==
COMP-+
([
0-9]
)
]]
||
\
(
echo
"Invalid computer id specified."
;
exit
1
)
show_error_exit
"Invalid computer id specified."
if
[[
-f
"
$2
"
]]
;
then
echo
"Copy certificate from
$2
to
$node_certificate_file
"
...
...
@@ -136,7 +146,7 @@ if [[ -f "$2" ]] ; then
elif
[[
!
-f
$node_certificate_file
]]
;
then
read
-p
"Where is certificate file: "
certificate_file
[[
!
-f
"
$certificate_file
"
]]
&&
\
echo
"Certificate file
$certificate_file
doesn't exists."
&&
exit
1
show_error_exit
"Certificate file
$certificate_file
doesn't exists."
echo
"Copy certificate from
$certificate_file
to
$node_certificate_file
"
cp
$certificate_file
$node_certificate_file
fi
...
...
@@ -147,7 +157,7 @@ if [[ -f "$3" ]] ; then
elif
[[
!
-f
$node_key_file
]]
;
then
read
-p
"Where is key file: "
key_file
[[
!
-f
"
$key_file
"
]]
&&
\
echo
"Key file
$key_file
doesn't exists."
&&
exit
1
show_error_exit
"Key file
$key_file
doesn't exists."
echo
"Copy key from
$key_file
to
$node_key_file
"
cp
$key_file
$node_key_file
fi
...
...
@@ -164,7 +174,7 @@ ip -4 addr add $ipv4_local_network dev $slapos_ifname
if
[[
!
-f
$node_config_file
]]
;
then
[[
-f
$node_template_file
]]
||
\
(
cd
/etc/slapos
;
wget http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/slapos.cfg.example
)
||
\
(
echo
"Download slapos.cfg.example failed."
;
exit
1
)
show_error_exit
"Download slapos.cfg.example failed."
cp
$node_template_file
$node_config_file
fi
...
...
@@ -176,6 +186,16 @@ sed -i -e "s%^\\s*interface_name.*$%interface_name = $interface_guid%" \
-e
"s%^computer_id.*
$%
computer_id =
$computer_id
%"
\
$node_config_file
# Config slapproxy
if
[[
$(
grep
-q
"^
\[
slapproxy
\]
"
$node_config_file
)
]]
;
then
echo
"
[slapproxy]
host = 127.0.0.1
port = 28080
database_uri = /var/lib/slapproxy.db
"
>>
$node_config_file
fi
#
# Re6stnet
#
...
...
@@ -230,7 +250,8 @@ cd /etc/re6stnet
if
[[
!
-f
re6stnet.conf
]]
;
then
re6st-conf
--registry
http://re6stnet.nexedi.com/
fi
[[
!
-f
re6stnet.conf
]]
&&
echo
"Register to nexedi re6stnet failed"
&&
exit
1
[[
!
-f
re6stnet.conf
]]
&&
show_error_exit
"Register to nexedi re6stnet failed"
grep
-q
"^table "
re6stnet.conf
||
echo
"table 0"
>>
re6stnet.conf
#
# Add run item when windows startup
...
...
@@ -246,6 +267,8 @@ echo "Add ${init_script}.sh as Windows startup item."
regtool
-q
set
"
$run_key
\\
$slapos_run_entry
"
\
"
\"
$(
cygpath
-w
/usr/bin/bash
)
\"
--login -i
${
init_script
}
.sh"
||
\
echo
"Add startup item failed."
show_error_exit
"Add startup item failed."
echo
SlapOS Node configure successfully.
read
-n
-t
10
-p
"Press any key to exit..."
exit
0
windows/scripts/slapos.iss
View file @
23a7d2a2
...
...
@@ -70,7 +70,7 @@ Name: "{group}\SlapOS"; Filename: "{app}\cygwin\etc\slapos\desktop\index.html";
Name: "{group}\Node Manager"; Filename: "{app}\cygwin\etc\slapos\node\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\node"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\Configure Client"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/slapos-client-config.sh"; WorkingDir: "{app}\cygwin\etc\slapos\scripts"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\Configure Node"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/slapos-node-config.sh"; WorkingDir: "{app}\cygwin\etc\slapos\scripts"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i
/opt/slapos/bin/slapconsole /etc/opt/slapos/slapos.cfg
"; WorkingDir: "{app}\cygwin\etc\slapos\scripts"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i
-c ""/opt/slapos/bin/slapconsole /etc/opt/slapos/slapos.cfg""
"; WorkingDir: "{app}\cygwin\etc\slapos\scripts"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Update Center"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/build-slapos.sh"; WorkingDir: "{app}\cygwin\etc\slapos\scripts"; IconFilename: "{app}\cygwin\etc\slapos\images\updater.ico";
Name: "{group}\User Guide"; Filename: "{app}\user-guide.html";
Name: "{group}\Read Me"; Filename: "{app}\Readme.txt";
...
...
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