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
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
Alain Takoudjou
slapos.package
Commits
005becea
Commit
005becea
authored
Jul 10, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refine slapos configure scripts.
parent
5826156b
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
186 additions
and
133 deletions
+186
-133
windows/scripts/build-slapos.sh
windows/scripts/build-slapos.sh
+36
-20
windows/scripts/post-install.sh
windows/scripts/post-install.sh
+61
-42
windows/scripts/pre-uninstall.sh
windows/scripts/pre-uninstall.sh
+21
-17
windows/scripts/slapos-all-in-one.iss
windows/scripts/slapos-all-in-one.iss
+3
-3
windows/scripts/slapos-configure.sh
windows/scripts/slapos-configure.sh
+53
-46
windows/scripts/slapos-include.sh
windows/scripts/slapos-include.sh
+3
-2
windows/scripts/slapos-node.sh
windows/scripts/slapos-node.sh
+6
-0
windows/scripts/slapos.iss
windows/scripts/slapos.iss
+3
-3
No files found.
windows/scripts/build-slapos.sh
View file @
005becea
#! /bin/bash
#! /bin/bash
export
PATH
=
/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:
$PATH
export
PATH
=
/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:
$PATH
function
show_error_exit
()
{
echo
Error:
${
1
-Error
:
build slapos failed.
}
read
-n
1
-p
"Press any key to exit..."
exit
1
}
slapos_home
=
${
1
-/opt/slapos
}
slapos_home
=
${
1
-/opt/slapos
}
slapos_cache
=
/opt/download-cache
slapos_cache
=
/opt/download-cache
slapos_url
=
http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-0:/component/slapos/buildout.cfg
slapos_url
=
http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-0:/component/slapos/buildout.cfg
...
@@ -11,8 +18,9 @@ patch_files=/etc/slapos/patches/slapos-core-format.patch
...
@@ -11,8 +18,9 @@ patch_files=/etc/slapos/patches/slapos-core-format.patch
mkdir
-p
$slapos_home
/log
mkdir
-p
$slapos_home
/log
mkdir
-p
$slapos_cache
mkdir
-p
$slapos_cache
echo
"Checking
$slapos_cfg
..."
if
[[
-r
$slapos_cfg
]]
;
then
if
[[
-r
$slapos_cfg
]]
;
then
echo
"Change
$slapos_
home
/buildout.cfg with
"
echo
"Change
$slapos_
cfg
:
"
echo
" extends =
${
slapos_url
}
"
echo
" extends =
${
slapos_url
}
"
sed
-i
-e
"s%^extends = .*
$%
extends =
${
slapos_url
}
%g"
$slapos_cfg
sed
-i
-e
"s%^extends = .*
$%
extends =
${
slapos_url
}
%g"
$slapos_cfg
else
else
...
@@ -22,36 +30,44 @@ extends = ${slapos_url}
...
@@ -22,36 +30,44 @@ extends = ${slapos_url}
download-cache =
${
slapos_cache
}
download-cache =
${
slapos_cache
}
prefix =
$$
{buildout:directory}
prefix =
$$
{buildout:directory}
EOF
EOF
echo
"
$slapos_home
/buildout.cfg cre
ated."
echo
"
File
$slapos_cfg
has been gener
ated."
fi
fi
echo
"Checking
$slapos_bootstrap
..."
if
[[
!
-f
$slapos_bootstrap
]]
;
then
if
[[
!
-f
$slapos_bootstrap
]]
;
then
python
-S
-c
'import urllib2;print urllib2.urlopen("http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/bootstrap.py").read()'
>
$slapos_bootstrap
echo
"Downloading
$slapos_bootstrap
..."
echo
"
$slapos_bootstrap
downloaded."
python
-S
-c
'import urllib2;print urllib2.urlopen("http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/bootstrap.py").read()'
>
$slapos_bootstrap
||
if
(!
cd
$slapos_home
;
python
-S
bootstrap.py
)
;
then
show_error_exit
"Error: download
$slapos_bootstrap
"
echo
"SlapOS bootstrap failed
."
echo
"Downlaod
$slapos_bootstrap
OK
."
exit
1
else
fi
echo
OK.
fi
fi
# cd $slapos_home
if
[[
!
-x
$slapos_home
/run/buildout
]]
;
then
if
(!
cd
$slapos_home
;
$slapos_home
/bin/buildout
-v
-N
)
;
then
echo
"Bootstrap slapos ..."
echo
"SlapOS buildout
failed."
(
cd
$slapos_home
;
python
-S
bootstrap.py
)
||
show_error_exit
"Error: slapos bootstrap
failed."
e
xit
1
e
cho
"Bootstrap slapos OK."
fi
fi
echo
echo
Start buildout of slapos ...
echo
(
cd
$slapos_home
;
$slapos_home
/bin/buildout
-v
-N
)
||
show_error_exit
"Error slapos buildout failed."
# apply patches
# apply patches
for
filename
in
$patch_files
;
do
for
_
filename
in
$patch_files
;
do
if
[[
-r
$
filename
]]
;
then
if
[[
-r
$
{
_filename
}
]]
;
then
echo
"Apply patch:
$
filename
"
echo
"Apply patch:
$
{
_filename
}
"
for
x
in
$(
find
$slapos_home
/eggs
-name
slapos.core-
*
.egg
)
;
do
for
_path
in
$(
find
$slapos_home
/eggs
-name
slapos.core-
*
.egg
)
;
do
echo
" at
$
x
..."
echo
" at
$
{
_path
}
..."
(
cd
$
x
;
patch
-f
--dry-run
-p1
<
$filename
>
/dev/null
&&
\
(
cd
$
{
_path
}
;
patch
-f
--dry-run
-p1
<
${
_filename
}
>
/dev/null
&&
patch
-p1
<
$
filename
&&
echo
"
OK."
)
patch
-p1
<
$
{
_filename
}
&&
echo
"
OK."
)
done
done
fi
fi
done
done
echo
Build SlapOS successfully.
echo
echo
Build slapos node successfully.
echo
read
-n
1
-t
60
-p
"Press any key to exit..."
read
-n
1
-t
60
-p
"Press any key to exit..."
exit
0
exit
0
windows/scripts/post-install.sh
View file @
005becea
...
@@ -16,28 +16,26 @@
...
@@ -16,28 +16,26 @@
#
#
function
show_error_exit
()
function
show_error_exit
()
{
{
echo
Error:
$
1
echo
Error:
$
{
1
-Run post-install script failed.
}
read
-n
1
-p
"Press any key to exit..."
read
-n
1
-p
"Press any key to exit..."
exit
1
exit
1
}
}
password_filename
=
/etc/passwd
password_filename
=
/etc/passwd
echo
Checking
passwd file
...
echo
Checking
/etc/passwd
...
if
[[
!
-f
$password_filename
]]
;
then
if
[[
!
-f
$password_filename
]]
;
then
echo
No passwd file found.
mkpasswd
-l
>
$password_filename
||
show_error_exit
"Error: mkpasswd failed"
mkpasswd
-l
>
$password_filename
||
show_error_exit
"mkpasswd failed"
echo
File /etc/passwd has been generated.
echo
Generate passwd file OK.
else
else
echo
Check passwd file
OK.
echo
OK.
fi
fi
echo
Checking
group file
...
echo
Checking
/etc/group
...
if
[[
!
-f
/etc/group
]]
;
then
if
[[
!
-f
/etc/group
]]
;
then
echo
No group file found.
mkgroup
-l
>
/etc/group
||
show_error_exit
"Error: mkgroup failed"
mkgroup
-l
>
/etc/group
||
show_error_exit
"mkgroup failed"
echo
File /etc/group has been generated.
echo
Generate group file OK.
else
else
echo
Check group file
OK.
echo
OK.
fi
fi
# grep -q "^root:" $password_filename
# grep -q "^root:" $password_filename
...
@@ -51,25 +49,32 @@ fi
...
@@ -51,25 +49,32 @@ fi
# fi
# fi
# fi
# fi
DEFAULT_SYSTEM_CHARSET
=
$(
ipwin codepage
)
||
echo
Checking Windows OEM Codepage ...
DEFAULT_SYSTEM_CHARSET
=
""
_charset
=
$(
ipwin codepage
)
||
_charset
=
""
if
[[
!
-f
~/.minttyrc
]]
;
then
echo
Windows OEM Codepage is
${
_charset
}
echo
Creating ~/.minttyrc
cat
<<
EOF
> ~/.minttyrc
_filename
=
"~/.minttyrc"
echo
Checking
${
_filename
}
...
if
[[
!
-f
${
_filename
}
]]
;
then
echo
Creating
${
_filename
}
cat
<<
EOF
>
${
_filename
}
BoldAsFont=no
BoldAsFont=no
Font=Courier New
Font=Courier New
FontHeight=16
FontHeight=16
Scrollbar=none
Scrollbar=none
Locale=C
Locale=C
Charset=
${
DEFAULT_SYSTEM_CHARSET
}
Charset=
${
_charset
}
EOF
EOF
echo
File ~/.minttyrc created
echo
File
${
_filename
}
has been generated.
else
echo
OK.
fi
fi
if
[[
!
-f
/cygtty.bat
]]
;
then
_filename
=
"/cygtty.bat"
echo
Creating /cygtty.bat
echo
Checking
${
_filename
}
...
if
[[
!
-x
${
_filename
}
]]
;
then
cyghome
=
$(
cygpath
-w
/
)
cyghome
=
$(
cygpath
-w
/
)
cat
<<
EOF
>
/cygtty.bat
cat
<<
EOF
>
${
_filename
}
@echo off
@echo off
${
cyghome
:0:2
}
${
cyghome
:0:2
}
...
@@ -77,13 +82,15 @@ chdir ${cyghome}\\bin
...
@@ -77,13 +82,15 @@ chdir ${cyghome}\\bin
start mintty.exe -i /Cygwin-Terminal.ico -
start mintty.exe -i /Cygwin-Terminal.ico -
EOF
EOF
chmod
+x /cygtty.bat
chmod
+x
${
_filename
}
echo
File /cygtty.bat created.
echo
File
${
_filename
}
has been generated.
else
echo
OK.
fi
fi
# Copy rebaseall.bat to /
_filename
=
"/autorebase.bat"
if
[[
!
-f
/autorebase.bat
]]
;
then
echo
Checking
${
_filename
}
...
echo
Create /autorebase.bat
if
[[
!
-f
${
_filename
}
]]
;
then
cat
<<
EOF
> /autorebase.bat
cat
<<
EOF
> /autorebase.bat
@echo off
@echo off
rem Postinstall scripts are always started from the Cygwin root dir
rem Postinstall scripts are always started from the Cygwin root dir
...
@@ -91,37 +98,49 @@ rem so we can just call dash from here
...
@@ -91,37 +98,49 @@ rem so we can just call dash from here
path .
\b
in;%path%
path .
\b
in;%path%
dash /bin/rebaseall -p
dash /bin/rebaseall -p
EOF
EOF
chmod
+x /autorebase.bat
chmod
+x
${
_filename
}
echo
/autorebase.bat created.
echo
File
${
_filename
}
has been generated.
else
echo
OK.
fi
fi
# Change format of readme.txt
# Change format of readme.txt
readme_filepath
=
$(
cygpath
-m
/
)
/..
_filename
=
$(
cygpath
-u
$(
cygpath
-m
/
)
/../readme.txt
)
if
[[
-f
$
readme_filepath
/Readme.txt
]]
;
then
if
[[
-f
$
{
_filename
}
]]
;
then
unix2dos
$readme_filepath
/Readme.txt
echo
Changing
$(
cygpath
-w
${
_filename
}
)
as dos format ...
echo
Change readme.txt to dos format
OK.
unix2dos
${
_filename
}
&&
echo
OK.
fi
fi
# Remove cygwin services to be sure these services will be configured
# Remove cygwin services to be sure these services will be configured
# in this cygwin enviroments when there are many cygwin instances
# in this cygwin enviroments when there are many cygwin instances
# installed in this computer.
# installed in this computer.
for
name
in
$(
cygrunsrv
--list
)
;
do
for
name
in
$(
cygrunsrv
--list
)
;
do
echo
Removing cygservice
$name
echo
Removing
$name
service
cygrunsrv
-R
$name
cygrunsrv
-R
$name
||
show_error_exit
echo
OK.
done
done
# Backup slap-runner.html
# Backup slap-runner.html
cp
/etc/slapos/scripts/slap-runner.html
{
,.orig
}
_filename
=
/etc/slapos/scripts/slap-runner.html
if
[[
-r
${
_filename
}
]]
;
then
echo
Backuping
${
_filename
}
as
${
_filename
}
.orig
cp
${
_filename
}
{
,.orig
}
&&
echo
OK.
else
echo
Warning: Missing
${
_filename
}
fi
# Unzip slapos.tar.gz
# Unzip slapos.tar.gz
if
[[
-r
/opt/downloads/slapos.tar.gz
]]
;
then
_filename
=
/opt/downloads/slapos.tar.gz
echo
Extracting slapos.tar.gz
if
[[
-r
${
_filename
}
]]
;
then
cd
/opt
echo
Extracting
${
_filename
}
...
tar
xzf /opt/downloads/slapos.tar.gz
--no-same-owner
||
(
cd
/opt
;
tar
xzf
${
_filename
}
--no-same-owner
)
||
show_error_exit
show_error_exit
"Failed to untar slapos.tar.gz"
echo
OK.
echo
Extracte slapos.tar.gz OK.
elif
[[
!
-d
/opt/slapos
]]
;
then
echo
Warning: Missing
${
_filename
}
fi
fi
echo
Run post-install script successfully.
echo
echo
Run post-install.sh script successfully.
echo
read
-n
1
-t
60
-p
"Press any key to exit..."
read
-n
1
-t
60
-p
"Press any key to exit..."
exit
0
exit
0
windows/scripts/pre-uninstall.sh
View file @
005becea
...
@@ -23,10 +23,10 @@ export PATH=/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:$PATH
...
@@ -23,10 +23,10 @@ export PATH=/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:$PATH
for
ifname
in
$(
netsh interface ipv6 show interface | gawk
'{ print $5 }'
)
;
do
for
ifname
in
$(
netsh interface ipv6 show interface | gawk
'{ print $5 }'
)
;
do
if
[[
"
$ifname
"
==
"re6stnet-lo"
]]
;
then
if
[[
"
$ifname
"
==
"re6stnet-lo"
]]
;
then
echo
Removing network connection:
$ifname
echo
Removing network connection:
$ifname
ipwin remove
*
msloop re6stnet-lo
ipwin remove
*
msloop re6stnet-lo
&&
echo
OK.
elif
[[
"
$ifname
"
==
re6stnet
*
]]
;
then
elif
[[
"
$ifname
"
==
re6stnet
*
]]
;
then
echo
Removing network connection:
$ifname
echo
Removing network connection:
$ifname
ipwin remove tap0901
$ifname
ipwin remove tap0901
$ifname
&&
echo
OK.
fi
fi
done
done
...
@@ -34,10 +34,10 @@ done
...
@@ -34,10 +34,10 @@ done
# Remove services installed by cygwin,
# Remove services installed by cygwin,
#
#
echo
Try to
kill
openvpn process ...
echo
Try to
kill
openvpn process ...
ps
-ef
|
grep
-q
"/usr/bin/openvpn"
&&
TASKKILL /IM openvpn.exe /F
ps
-ef
|
grep
-q
"/usr/bin/openvpn"
&&
TASKKILL /IM openvpn.exe /F
&&
echo
OK.
for
name
in
$(
cygrunsrv
--list
)
;
do
for
name
in
$(
cygrunsrv
--list
)
;
do
echo
Removing cygservice
$name
echo
Removing cygservice
$name
cygrunsrv
-R
$name
cygrunsrv
-R
$name
&&
echo
OK.
done
done
#
#
...
@@ -45,33 +45,35 @@ done
...
@@ -45,33 +45,35 @@ done
#
#
for
name
in
$(
net user
)
;
do
for
name
in
$(
net user
)
;
do
if
[[
"x
$name
"
==
x
\*
slapuser
*
]]
;
then
if
[[
"x
$name
"
==
x
\*
slapuser
*
]]
;
then
echo
Remov
e
user:
$name
echo
Remov
ing
user:
$name
net user
$name
/delete
net user
$name
/delete
&&
echo
OK.
elif
echo
"
$name
"
|
grep
-q
-E
"(sshd)|(cyg_server)|(slaproot)"
;
then
elif
echo
"
$name
"
|
grep
-q
-E
"(sshd)|(cyg_server)|(slaproot)"
;
then
echo
Remov
e
user:
$name
echo
Remov
ing
user:
$name
net user
$name
/delete
net user
$name
/delete
&&
echo
OK.
fi
fi
done
done
mkpasswd
-l
>
/etc/passwd
echo
"Creating /etc/passwd ..."
mkpasswd
-l
>
/etc/passwd
&&
echo
OK.
#
#
# Remove local group installed by slapos node
# Remove local group installed by slapos node
#
#
for
name
in
$(
net localgroup |
sed
-n
-e
"s/^*//p"
|
sed
-e
"s/
\\
s//g"
)
;
do
for
name
in
$(
net localgroup |
sed
-n
-e
"s/^*//p"
|
sed
-e
"s/
\\
s//g"
)
;
do
if
[[
"
$name
"
==
grp_slapuser
*
]]
;
then
if
[[
"
$name
"
==
grp_slapuser
*
]]
;
then
echo
Remov
e
localgroup:
$name
echo
Remov
ing
localgroup:
$name
net localgroup
$name
/delete
net localgroup
$name
/delete
&&
echo
OK.
fi
fi
done
done
mkgroup
-l
>
/etc/group
echo
"Creating /etc/group ..."
mkgroup
-l
>
/etc/group
&&
echo
OK.
#
#
# Remove configure files
# Remove configure files
#
#
echo
Removing /etc/opt/slapos
echo
Removing /etc/opt/slapos
rm
-rf
/etc/opt/slapos/
rm
-rf
/etc/opt/slapos/
&&
echo
OK.
echo
Removing ~/.slapos
echo
Removing ~/.slapos
rm
-rf
~/.slapos
rm
-rf
~/.slapos
&&
echo
OK.
#
#
# Remove slapos-configure from windows startup item
# Remove slapos-configure from windows startup item
...
@@ -79,14 +81,16 @@ rm -rf ~/.slapos
...
@@ -79,14 +81,16 @@ rm -rf ~/.slapos
slapos_run_key
=
'\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
slapos_run_key
=
'\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
slapos_run_entry
=
slapos-configure
slapos_run_entry
=
slapos-configure
echo
Removing startup item
"
$slapos_run_key
\\
$slapos_run_entry
"
echo
Removing startup item
"
$slapos_run_key
\\
$slapos_run_entry
"
regtool
-q
unset
"
$slapos_run_key
\\
$slapos_run_entry
"
regtool
-q
unset
"
$slapos_run_key
\\
$slapos_run_entry
"
&&
echo
OK.
#
#
# Remove default instance root, because it belong to slapuser, and
# Remove default instance root, because it belong to slapuser, and
# would be removed by the windows uninstaller.
# would be removed by the windows uninstaller.
#
#
[[
-f
/srv/slapgrid
]]
&&
echo
Removing /srv/slapgrid
&&
rm
-rf
/srv/slapgrid
[[
-f
/srv/slapgrid
]]
&&
echo
Removing /srv/slapgrid
&&
rm
-rf
/srv/slapgrid
&&
echo
OK.
echo
Run pre-uninstall script successfully.
echo
echo
Run pre-uninstall script complete.
echo
read
-n
1
-t
60
-p
"Press any key to exit..."
read
-n
1
-t
60
-p
"Press any key to exit..."
exit
0
exit
0
windows/scripts/slapos-all-in-one.iss
View file @
005becea
...
@@ -72,10 +72,10 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D
...
@@ -72,10 +72,10 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D
[Icons]
[Icons]
Name: "{commondesktop}\SlapOS"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{commondesktop}\SlapOS"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\cygtty.bat"; WorkingDir: "{app}\cygwin\opt\slapos"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\cygtty.bat"; WorkingDir: "{app}\cygwin\opt\slapos"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Configure SlapOS"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -h
never -t ""Configure SlapOS Node
"" /etc/slapos/scripts/slapos-configure.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\Configure SlapOS"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -h
error -t ""Configure SlapOS
"" /etc/slapos/scripts/slapos-configure.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\SlapOS Runner"; Filename: "{app}\cygwin\etc\slapos\scripts\slap-runner.html"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\SlapOS Runner"; Filename: "{app}\cygwin\etc\slapos\scripts\slap-runner.html"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\SlapOS"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\SlapOS"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\SlapOS Node"; Filename: "{app}\cygwin\bin\
bash.exe"; Parameters: "--login -i
/etc/slapos/scripts/slapos-node.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\SlapOS Node"; Filename: "{app}\cygwin\bin\
mintty.exe"; Parameters: "-c ~/.minttyrc -h error -t ""SlapOS Node""
/etc/slapos/scripts/slapos-node.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\Uninstall SlapOS"; Filename: "{uninstallexe}";
Name: "{group}\Uninstall SlapOS"; Filename: "{uninstallexe}";
Name: "{group}\User Guide"; Filename: "{app}\user-guide.html";
Name: "{group}\User Guide"; Filename: "{app}\user-guide.html";
...
@@ -85,7 +85,7 @@ Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scrip
...
@@ -85,7 +85,7 @@ Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scrip
Filename: "{app}\cygwin\autorebase.bat"; WorkingDir: "{app}\cygwin"; Flags: skipifdoesntexist runhidden;
Filename: "{app}\cygwin\autorebase.bat"; WorkingDir: "{app}\cygwin"; Flags: skipifdoesntexist runhidden;
[UninstallRun]
[UninstallRun]
Filename: "{app}\cygwin\bin\
bash.exe"; Parameters: "--login -i
/etc/slapos/scripts/pre-uninstall.sh"; WorkingDir: "{app}\cygwin\bin"; Flags: skipifdoesntexist;
Filename: "{app}\cygwin\bin\
mintty.exe"; Parameters: "-c ~/.minttyrc -h never -t ""Uninstall SlapOS""
/etc/slapos/scripts/pre-uninstall.sh"; WorkingDir: "{app}\cygwin\bin"; Flags: skipifdoesntexist;
[UninstallDelete]
[UninstallDelete]
Type: filesandordirs; Name: "{app}\cygwin" ;
Type: filesandordirs; Name: "{app}\cygwin" ;
...
...
windows/scripts/slapos-configure.sh
View file @
005becea
...
@@ -47,6 +47,10 @@
...
@@ -47,6 +47,10 @@
#
#
source
$(
/usr/bin/dirname
$0
)
/slapos-include.sh
source
$(
/usr/bin/dirname
$0
)
/slapos-include.sh
echo
echo
Start slapos node configure ...
echo
if
[[
!
":
$PATH
"
==
:/opt/slapos/bin:
]]
;
then
if
[[
!
":
$PATH
"
==
:/opt/slapos/bin:
]]
;
then
for
profile
in
~/.bash_profile ~/.profile
;
do
for
profile
in
~/.bash_profile ~/.profile
;
do
grep
-q
"export PATH=/opt/slapos/bin:"
$profile
||
grep
-q
"export PATH=/opt/slapos/bin:"
$profile
||
...
@@ -55,10 +59,8 @@ if [[ ! ":$PATH" == :/opt/slapos/bin: ]] ; then
...
@@ -55,10 +59,8 @@ if [[ ! ":$PATH" == :/opt/slapos/bin: ]] ; then
fi
fi
# cygrunsrv
# cygrunsrv
# cron-config
# ssh-host-config
# ssh-host-config
# syslog-ng-config
# syslog-ng-config
# devcon
# openssl
# openssl
# export WINDIR
# export WINDIR
# ipwin
# ipwin
...
@@ -79,13 +81,16 @@ mkdir -p /etc/re6stnet
...
@@ -79,13 +81,16 @@ mkdir -p /etc/re6stnet
# Create account: slaproot
# Create account: slaproot
# -----------------------------------------------------------
# -----------------------------------------------------------
# Start seclogon service in the Windows XP
# Start seclogon service in the Windows XP
csih_is_xp
&&
sc config seclogon
start
=
auto
if
csih_is_xp
;
then
echo
"Set start property of seclogon to auto"
sc config seclogon
start
=
auto
||
csih_warning
"Warning: failed to set seclogon to auto start."
# In the later, it's RunAs service, and will start by default
# In the later, it's RunAs service, and will start by default
fi
# echo Checking slapos account $slapos_admin ...
# echo Checking slapos account $slapos_admin ...
slapos_check_and_create_privileged_user
$slapos_admin
||
slapos_check_and_create_privileged_user
$slapos_admin
||
show_error_exit
"Failed to create account
$slapos_admin
."
csih_error
"Failed to create account
$slapos_admin
."
_password
=
"
${
csih_PRIVILEGED_PASSWORD
}
"
# -----------------------------------------------------------
# -----------------------------------------------------------
# Configure cygwin services: cygserver syslog-ng sshd
# Configure cygwin services: cygserver syslog-ng sshd
...
@@ -96,7 +101,7 @@ echo
...
@@ -96,7 +101,7 @@ echo
if
!
cygrunsrv
--query
cygserver
>
/dev/null 2>&1
;
then
if
!
cygrunsrv
--query
cygserver
>
/dev/null 2>&1
;
then
echo
Run cygserver-config ...
echo
Run cygserver-config ...
/usr/bin/cygserver-config
--yes
||
\
/usr/bin/cygserver-config
--yes
||
\
show_error_exit
"Failed to run cygserver-config"
csih_error
"Failed to run cygserver-config"
else
else
echo
The cygserver service has been installed.
echo
The cygserver service has been installed.
fi
fi
...
@@ -105,20 +110,20 @@ check_cygwin_service cygserver
...
@@ -105,20 +110,20 @@ check_cygwin_service cygserver
if
!
cygrunsrv
--query
syslog-ng
>
/dev/null 2>&1
;
then
if
!
cygrunsrv
--query
syslog-ng
>
/dev/null 2>&1
;
then
echo
Run syslog-ng-config ...
echo
Run syslog-ng-config ...
/usr/bin/syslog-ng-config
--yes
||
\
/usr/bin/syslog-ng-config
--yes
||
\
show_error_exit
"Failed to run syslog-ng-config"
csih_error
"Failed to run syslog-ng-config"
else
else
echo
The syslog-ng service has been installed.
echo
The syslog-ng service has been installed.
fi
fi
check_cygwin_service syslog-ng
check_cygwin_service syslog-ng
if
!
cygrunsrv
--query
sshd
>
/dev/null 2>&1
;
then
if
!
cygrunsrv
--query
sshd
>
/dev/null 2>&1
;
then
if
csih_is_xp
&&
[[
-z
"
${
_password
}
"
]]
;
then
if
csih_is_xp
&&
[[
-z
"
${
csih_PRIVILEGED_PASSWORD
}
"
]]
;
then
slapos_request_password
$slapos_admin
"Install sshd service need the password of
$slapos_admin
."
slapos_request_password
$slapos_admin
"Install sshd service need the password of
$slapos_admin
."
fi
fi
echo
Run ssh-host-config ...
echo
Run ssh-host-config ...
/usr/bin/ssh-host-config
--yes
--cygwin
ntsec
\
/usr/bin/ssh-host-config
--yes
--cygwin
ntsec
\
--user
$slapos_admin
--pwd
${
_password
}
||
--user
$slapos_admin
--pwd
${
csih_PRIVILEGED_PASSWORD
}
||
show_error_exit
"Failed to run ssh-host-config"
csih_error
"Failed to run ssh-host-config"
else
else
echo
The sshd service has been installed.
echo
The sshd service has been installed.
fi
fi
...
@@ -127,20 +132,20 @@ check_cygwin_service sshd
...
@@ -127,20 +132,20 @@ check_cygwin_service sshd
# Use slapos-cron-config to configure slapos cron service.
# Use slapos-cron-config to configure slapos cron service.
if
!
cygrunsrv
--query
cron
>
/dev/null 2>&1
;
then
if
!
cygrunsrv
--query
cron
>
/dev/null 2>&1
;
then
[[
-x
$slapos_cron_config
]]
||
[[
-x
$slapos_cron_config
]]
||
show_error_exit
"Couldn't find slapos cron config script:
$slapos_cron_config
"
csih_error
"Couldn't find slapos cron config script:
$slapos_cron_config
"
if
csih_is_xp
&&
[[
-z
"
${
_password
}
"
]]
;
then
if
[[
-z
"
${
csih_PRIVILEGED_PASSWORD
}
"
]]
;
then
slapos_request_password
$slapos_admin
"Install cron service need the password of
$slapos_admin
."
slapos_request_password
$slapos_admin
"Install cron service need the password of
$slapos_admin
."
fi
fi
echo
Run slapos-cron-config ...
echo
Run slapos-cron-config ...
$slapos_cron_config
$slapos_admin
${
_password
}
||
show_error_exit
"Failed to run cron-config"
$slapos_cron_config
$slapos_admin
${
csih_PRIVILEGED_PASSWORD
}
||
csih_error
"Failed to run
$slapos_cron_config
"
else
else
echo
The cron service has been installed.
echo
The cron service has been installed.
fi
fi
check_cygwin_service cron
check_cygwin_service cron
echo
echo
echo
Configure cygwin services OK.
echo
Configure cygwin services OK.
echo
echo
...
@@ -169,7 +174,7 @@ echo Starting configure IPv6 protocol ...
...
@@ -169,7 +174,7 @@ echo Starting configure IPv6 protocol ...
echo
echo
netsh interface ipv6 show interface
>
/dev/null
||
\
netsh interface ipv6 show interface
>
/dev/null
||
\
netsh interface ipv6
install
||
\
netsh interface ipv6
install
||
\
show_error_exit
"Failed to install IPv6 protocol."
csih_error
"Failed to install IPv6 protocol."
echo
echo
echo
Configure IPv6 protocol OK.
echo
Configure IPv6 protocol OK.
echo
echo
...
@@ -182,13 +187,13 @@ echo Starting configure section config ...
...
@@ -182,13 +187,13 @@ echo Starting configure section config ...
echo
echo
[[
-r
$node_template_file
&&
-r
$client_template_file
]]
||
\
[[
-r
$node_template_file
&&
-r
$client_template_file
]]
||
\
create_template_configure_file
||
\
create_template_configure_file
||
\
show_error_exit
"Failed to create template configure file."
csih_error
"Failed to create template configure file."
if
[[
!
-f
$node_certificate_file
]]
;
then
if
[[
!
-f
$node_certificate_file
]]
;
then
read
-p
"Where is computer certificate file
$(
cygpath
-w
/computer.crt
)
: "
filename
read
-p
"Where is computer certificate file
$(
cygpath
-w
/computer.crt
)
: "
filename
[[
-z
"
$filename
"
]]
&&
filename
=
"/computer.crt"
[[
-z
"
$filename
"
]]
&&
filename
=
"/computer.crt"
[[
!
-r
"
$filename
"
]]
&&
\
[[
!
-r
"
$filename
"
]]
&&
\
show_error_exit
"Computer certificate file
$filename
doesn't exists."
csih_error
"Computer certificate file
$filename
doesn't exists."
echo
"Copy certificate from
$filename
to
$node_certificate_file
"
echo
"Copy certificate from
$filename
to
$node_certificate_file
"
filename
=
$(
cygpath
-u
$filename
)
filename
=
$(
cygpath
-u
$filename
)
cp
$filename
$node_certificate_file
cp
$filename
$node_certificate_file
...
@@ -196,13 +201,13 @@ else
...
@@ -196,13 +201,13 @@ else
echo
"Found computer certificate file:
$node_certificate_file
"
echo
"Found computer certificate file:
$node_certificate_file
"
fi
fi
openssl x509
-noout
-in
$node_certificate_file
||
\
openssl x509
-noout
-in
$node_certificate_file
||
\
show_error_exit
"Invalid computer certificate:
$node_certificate_file
."
csih_error
"Invalid computer certificate:
$node_certificate_file
."
if
[[
!
-f
$node_key_file
]]
;
then
if
[[
!
-f
$node_key_file
]]
;
then
read
-p
"Where is computer key file
$(
cygpath
-w
/computer.key
)
: "
filename
read
-p
"Where is computer key file
$(
cygpath
-w
/computer.key
)
: "
filename
[[
-z
"
$filename
"
]]
&&
filename
=
"/computer.key"
[[
-z
"
$filename
"
]]
&&
filename
=
"/computer.key"
[[
!
-f
"
$filename
"
]]
&&
\
[[
!
-f
"
$filename
"
]]
&&
\
show_error_exit
"Key file
$filename
doesn't exists."
csih_error
"Key file
$filename
doesn't exists."
echo
"Copy key from
$filename
to
$node_key_file
"
echo
"Copy key from
$filename
to
$node_key_file
"
filename
=
$(
cygpath
-u
$filename
)
filename
=
$(
cygpath
-u
$filename
)
cp
$filename
$node_key_file
cp
$filename
$node_key_file
...
@@ -210,7 +215,7 @@ else
...
@@ -210,7 +215,7 @@ else
echo
"Found computer key file:
$node_key_file
"
echo
"Found computer key file:
$node_key_file
"
fi
fi
openssl rsa
-noout
-in
$node_key_file
-check
||
openssl rsa
-noout
-in
$node_key_file
-check
||
show_error_exit
"Invalid node key:
$node_key_file
."
csih_error
"Invalid node key:
$node_key_file
."
if
[[
!
-f
$node_configure_file
]]
;
then
if
[[
!
-f
$node_configure_file
]]
;
then
echo
"Copy computer configure file from
$node_template_file
to
$node_configure_file
"
echo
"Copy computer configure file from
$node_template_file
to
$node_configure_file
"
...
@@ -218,14 +223,14 @@ if [[ ! -f $node_configure_file ]] ; then
...
@@ -218,14 +223,14 @@ if [[ ! -f $node_configure_file ]] ; then
fi
fi
interface_guid
=
$(
ipwin guid
*
msloop
$slapos_ifname
)
||
interface_guid
=
$(
ipwin guid
*
msloop
$slapos_ifname
)
||
show_error_exit
"Failed to get guid of interface:
$slapos_ifname
."
csih_error
"Failed to get guid of interface:
$slapos_ifname
."
[[
"
$interface_guid
"
==
{
*
-
*
-
*
-
*
}
]]
||
[[
"
$interface_guid
"
==
{
*
-
*
-
*
-
*
}
]]
||
show_error_exit
"Invalid interface guid
$interface_guid
specified."
csih_error
"Invalid interface guid
$interface_guid
specified."
computer_guid
=
$(
grep
"CN=COMP"
$node_certificate_file
|
\
computer_guid
=
$(
grep
"CN=COMP"
$node_certificate_file
|
\
sed
-e
"s/^.*, CN=//g"
|
sed
-e
"s%/emailAddress.*
\$
%%g"
)
sed
-e
"s/^.*, CN=//g"
|
sed
-e
"s%/emailAddress.*
\$
%%g"
)
[[
"
$computer_guid
"
==
COMP-+
([
0-9]
)
]]
||
[[
"
$computer_guid
"
==
COMP-+
([
0-9]
)
]]
||
show_error_exit
"Invalid computer id '
$computer_guid
' specified."
csih_error
"Invalid computer id '
$computer_guid
' specified."
echo
"Computer configuration information:"
echo
"Computer configuration information:"
echo
" interface name:
$slapos_ifname
"
echo
" interface name:
$slapos_ifname
"
...
@@ -248,25 +253,25 @@ if [[ ! -f $client_certificate_file ]] ; then
...
@@ -248,25 +253,25 @@ if [[ ! -f $client_certificate_file ]] ; then
read
-p
"Where is client certificate file
$(
cygpath
-w
/certificate
)
: "
filename
read
-p
"Where is client certificate file
$(
cygpath
-w
/certificate
)
: "
filename
[[
-z
"
$filename
"
]]
&&
filename
=
"/certificate"
[[
-z
"
$filename
"
]]
&&
filename
=
"/certificate"
[[
!
-f
"
$filename
"
]]
&&
\
[[
!
-f
"
$filename
"
]]
&&
\
show_error_exit
"Client certificate file
$filename
doesn't exists."
csih_error
"Client certificate file
$filename
doesn't exists."
echo
"Copy client certificate from
$filename
to
$client_certificate_file
"
echo
"Copy client certificate from
$filename
to
$client_certificate_file
"
filename
=
$(
cygpath
-u
$filename
)
filename
=
$(
cygpath
-u
$filename
)
cp
$filename
$client_certificate_file
cp
$filename
$client_certificate_file
fi
fi
openssl x509
-noout
-in
$client_certificate_file
||
\
openssl x509
-noout
-in
$client_certificate_file
||
\
show_error_exit
"Invalid client certificate:
$client_certificate_file
."
csih_error
"Invalid client certificate:
$client_certificate_file
."
if
[[
!
-f
$client_key_file
]]
;
then
if
[[
!
-f
$client_key_file
]]
;
then
read
-p
"Where is client key file
$(
cygpath
-w
/key
)
: "
filename
read
-p
"Where is client key file
$(
cygpath
-w
/key
)
: "
filename
[[
-z
"
$filename
"
]]
&&
filename
=
"/key"
[[
-z
"
$filename
"
]]
&&
filename
=
"/key"
[[
!
-f
"
$filename
"
]]
&&
\
[[
!
-f
"
$filename
"
]]
&&
\
show_error_exit
"Key file
$filename
doesn't exists."
csih_error
"Key file
$filename
doesn't exists."
echo
"Copy client key from
$filename
to
$client_key_file
"
echo
"Copy client key from
$filename
to
$client_key_file
"
filename
=
$(
cygpath
-u
$filename
)
filename
=
$(
cygpath
-u
$filename
)
cp
$filename
$client_key_file
cp
$filename
$client_key_file
fi
fi
openssl rsa
-noout
-in
$client_key_file
-check
||
\
openssl rsa
-noout
-in
$client_key_file
-check
||
\
show_error_exit
"Invalid client key:
$client_key_file
."
csih_error
"Invalid client key:
$client_key_file
."
if
[[
!
-f
$client_configure_file
]]
;
then
if
[[
!
-f
$client_configure_file
]]
;
then
echo
"Copy client configure file from
$client_template_file
to
$client_configure_file
"
echo
"Copy client configure file from
$client_template_file
to
$client_configure_file
"
...
@@ -293,14 +298,14 @@ echo
...
@@ -293,14 +298,14 @@ echo
echo
Checking miniupnpc ...
echo
Checking miniupnpc ...
if
[[
!
-d
/opt/miniupnpc
]]
;
then
if
[[
!
-d
/opt/miniupnpc
]]
;
then
package
=
/opt/downloads/miniupnpc.tar.gz
package
=
/opt/downloads/miniupnpc.tar.gz
[[
-r
$package
]]
||
show_error_exit
"No package found:
$package
"
[[
-r
$package
]]
||
csih_error
"No package found:
$package
"
echo
"Installing miniupnpc ..."
echo
"Installing miniupnpc ..."
cd
/opt
cd
/opt
tar
xzf
$package
--no-same-owner
tar
xzf
$package
--no-same-owner
mv
$(
ls
-d
miniupnpc-
*
)
miniupnpc
mv
$(
ls
-d
miniupnpc-
*
)
miniupnpc
cd
miniupnpc
cd
miniupnpc
make
make
python setup.py
install
||
show_error_exit
"Failed to install miniupnpc."
python setup.py
install
||
csih_error
"Failed to install miniupnpc."
echo
"Install miniupnpc OK."
echo
"Install miniupnpc OK."
else
else
echo
Check miniupnpc OK.
echo
Check miniupnpc OK.
...
@@ -309,13 +314,13 @@ fi
...
@@ -309,13 +314,13 @@ fi
echo
Checking pyOpenSSL ...
echo
Checking pyOpenSSL ...
if
[[
!
-d
/opt/pyOpenSSL
]]
;
then
if
[[
!
-d
/opt/pyOpenSSL
]]
;
then
package
=
/opt/downloads/pyOpenSSL.tar.gz
package
=
/opt/downloads/pyOpenSSL.tar.gz
[[
-r
$package
]]
||
show_error_exit
"No package found:
$package
"
[[
-r
$package
]]
||
csih_error
"No package found:
$package
"
echo
"Installing pyOpenSSL ..."
echo
"Installing pyOpenSSL ..."
cd
/opt
cd
/opt
tar
xzf
$package
--no-same-owner
tar
xzf
$package
--no-same-owner
mv
$(
ls
-d
pyOpenSSL-
*
)
pyOpenSSL
mv
$(
ls
-d
pyOpenSSL-
*
)
pyOpenSSL
cd
pyOpenSSL
cd
pyOpenSSL
python setup.py
install
||
show_error_exit
"Failed ot install pyOpenSSL."
python setup.py
install
||
csih_error
"Failed ot install pyOpenSSL."
echo
"Install pyOpenSSL OK."
echo
"Install pyOpenSSL OK."
else
else
echo
Check pyOpenSSL OK.
echo
Check pyOpenSSL OK.
...
@@ -332,10 +337,10 @@ if [[ ! -d /opt/re6stnet ]] ; then
...
@@ -332,10 +337,10 @@ if [[ ! -d /opt/re6stnet ]] ; then
else
else
echo
"Clone re6stnet from http://git.erp5.org/repos/re6stnet.git"
echo
"Clone re6stnet from http://git.erp5.org/repos/re6stnet.git"
git clone
-b
cygwin http://git.erp5.org/repos/re6stnet.git
||
git clone
-b
cygwin http://git.erp5.org/repos/re6stnet.git
||
show_error_exit
"Failed to clone re6stnet.git"
csih_error
"Failed to clone re6stnet.git"
fi
fi
cd
re6stnet
cd
re6stnet
python setup.py
install
||
show_error_exit
"Failed to install re6stnet."
python setup.py
install
||
csih_error
"Failed to install re6stnet."
echo
"Install re6stnet OK."
echo
"Install re6stnet OK."
else
else
echo
Check re6stnet OK.
echo
Check re6stnet OK.
...
@@ -348,9 +353,9 @@ if [[ ! -r $re6stnet_configure_file ]] ; then
...
@@ -348,9 +353,9 @@ if [[ ! -r $re6stnet_configure_file ]] ; then
# Your subnet: 2001:67c:1254:e:19::/80 (CN=917529/32)
# Your subnet: 2001:67c:1254:e:19::/80 (CN=917529/32)
subnet
=
$(
re6st-conf
--registry
http://re6stnet.nexedi.com/
--anonymous
|
\
subnet
=
$(
re6st-conf
--registry
http://re6stnet.nexedi.com/
--anonymous
|
\
grep
"^Your subnet:"
)
||
\
grep
"^Your subnet:"
)
||
\
show_error_exit
"Register to nexedi re6stnet failed"
csih_error
"Register to nexedi re6stnet failed"
[[
-r
re6stnet.conf
]]
||
\
[[
-r
re6stnet.conf
]]
||
\
show_error_exit
"No
$re6stnet_configure_file
found."
csih_error
"No
$re6stnet_configure_file
found."
echo
Register re6stnet OK.
echo
Register re6stnet OK.
echo
"Write information to re6stnet.conf:"
echo
"Write information to re6stnet.conf:"
...
@@ -391,12 +396,12 @@ if check_re6stnet_needed ; then
...
@@ -391,12 +396,12 @@ if check_re6stnet_needed ; then
echo
"Checking interface
$name
..."
echo
"Checking interface
$name
..."
if
!
netsh interface ipv6 show interface |
grep
-q
"
\\
b
$name
\\
b"
;
then
if
!
netsh interface ipv6 show interface |
grep
-q
"
\\
b
$name
\\
b"
;
then
[[
-r
$openvpn_tap_driver_inf
]]
||
[[
-r
$openvpn_tap_driver_inf
]]
||
show_error_exit
"Failed to install OpenVPN Tap-Windows Driver, missing driver inf file:
$filename
"
csih_error
"Failed to install OpenVPN Tap-Windows Driver, missing driver inf file:
$filename
"
echo
"Installing interface
$name
..."
echo
"Installing interface
$name
..."
# ipwin install \"$filename\" $openvpn_tap_driver_hwid $name; ||
# ipwin install \"$filename\" $openvpn_tap_driver_hwid $name; ||
ip vpntap add dev
$name
||
ip vpntap add dev
$name
||
show_error_exit
"Failed to install OpenVPN Tap-Windows Driver."
csih_error
"Failed to install OpenVPN Tap-Windows Driver."
echo
"Interface
$name
installed."
echo
"Interface
$name
installed."
else
else
echo
"
$name
has been installed."
echo
"
$name
has been installed."
...
@@ -404,18 +409,20 @@ if check_re6stnet_needed ; then
...
@@ -404,18 +409,20 @@ if check_re6stnet_needed ; then
done
done
# Run re6stnet if no native ipv6
# Run re6stnet if no native ipv6
check_re6stnet_configure
||
exit
1
check_re6stnet_configure
||
csih_error
"Failed to configure re6stnet."
if
!
cygrunsrv
--query
$re6stnet_service_name
>
/dev/null 2>&1
;
then
if
!
cygrunsrv
--query
$re6stnet_service_name
>
/dev/null 2>&1
;
then
if
[[
-z
"
${
_password
}
"
]]
;
then
if
[[
-z
"
${
csih_PRIVILEGED_PASSWORD
}
"
]]
;
then
slapos_request_password
$slapos_admin
"Install re6stnet service need the password of
$slapos_admin
."
slapos_request_password
$slapos_admin
"Install re6stnet service need the password of
$slapos_admin
."
fi
fi
cygrunsrv
-I
$re6stnet_service_name
-c
$(
dirname
$re6stnet_configure_file
)
\
cygrunsrv
-I
$re6stnet_service_name
-c
$(
dirname
$re6stnet_configure_file
)
\
-p
$(
which re6stnet
)
-a
"@re6stnet.conf"
-d
"CYGWIN re6stnet"
\
-p
$(
which re6stnet
)
-a
"@re6stnet.conf"
-d
"CYGWIN re6stnet"
\
-u
$slapos_admin
-w
${
_password
}
||
-u
$slapos_admin
-w
${
csih_PRIVILEGED_PASSWORD
}
||
show_error_exit
"Failed to install cygwin service
$re6stnet_service_nam
e
."
csih_error
"Failed to install
$re6stnet_service_name
servic
e."
fi
fi
echo
"You can check log files in the /var/log/re6stnet/*.log"
echo
"You can check log files in the /var/log/re6stnet/*.log"
check_cygwin_service
$re6stnet_service_name
||
exit
1
check_cygwin_service
$re6stnet_service_name
||
csih_error
"Failed to start
$re6stnet_service_name
service."
else
else
echo
"Native IPv6 found, no taps required."
echo
"Native IPv6 found, no taps required."
fi
fi
...
@@ -447,7 +454,7 @@ if ! grep -q -F "$feature_code" $slaprunner_startup_file ; then
...
@@ -447,7 +454,7 @@ if ! grep -q -F "$feature_code" $slaprunner_startup_file ; then
fi
fi
/opt/slapos/bin/slapos node format
-cv
--now
||
\
/opt/slapos/bin/slapos node format
-cv
--now
||
\
show_error_exit
"Failed to run slapos format."
csih_error
"Failed to run slapos format."
echo
"Supply slapwebrunner in the computer
$computer_guid
"
echo
"Supply slapwebrunner in the computer
$computer_guid
"
/opt/slapos/bin/slapos supply slaposwebrunner
$computer_guid
/opt/slapos/bin/slapos supply slaposwebrunner
$computer_guid
...
@@ -482,7 +489,7 @@ if ! grep -q -F "$feature_code" $slaprunner_startup_file ; then
...
@@ -482,7 +489,7 @@ if ! grep -q -F "$feature_code" $slaprunner_startup_file ; then
grep
backend_url |
sed
-e
"s/^.*': '//g"
-e
"s/',.*
$/
/g"
)
grep
backend_url |
sed
-e
"s/^.*': '//g"
-e
"s/',.*
$/
/g"
)
echo
"SlapOS Web Runner URL:
$slaprunner_url
"
echo
"SlapOS Web Runner URL:
$slaprunner_url
"
[[
-z
"
$slaprunner_url
"
]]
&&
\
[[
-z
"
$slaprunner_url
"
]]
&&
\
show_error_exit
"Failed to create instance of SlapOS Web Runner."
csih_error
"Failed to create instance of SlapOS Web Runner."
cat
<<
EOF
>
$slaprunner_startup_file
cat
<<
EOF
>
$slaprunner_startup_file
<html>
<html>
...
@@ -542,7 +549,7 @@ else
...
@@ -542,7 +549,7 @@ else
fi
fi
echo
echo
echo
echo
cat
$slapos_crontab_file
||
show_error_exit
"No crob tab found."
cat
$slapos_crontab_file
||
csih_error
"No crob tab found."
echo
echo
echo
Configure section cron OK.
echo
Configure section cron OK.
echo
echo
...
@@ -557,7 +564,7 @@ echo
...
@@ -557,7 +564,7 @@ echo
# regtool -q get "$slapos_run_key\\$slapos_run_entry" || \
# regtool -q get "$slapos_run_key\\$slapos_run_entry" || \
# regtool -q set "$slapos_run_key\\$slapos_run_entry" \
# regtool -q set "$slapos_run_key\\$slapos_run_entry" \
# "\"$(cygpath -w /usr/bin/bash)\" --login -i $slapos_run_script" || \
# "\"$(cygpath -w /usr/bin/bash)\" --login -i $slapos_run_script" || \
#
show_error_exit
"Failed to add slapos-configure.sh as windows startup item."
#
csih_error
"Failed to add slapos-configure.sh as windows startup item."
# echo "Windows startup item:"
# echo "Windows startup item:"
# echo " $slapos_run_key\\$slapos_run_entry = " \
# echo " $slapos_run_key\\$slapos_run_entry = " \
# $(regtool get "$slapos_run_key\\$slapos_run_entry")
# $(regtool get "$slapos_run_key\\$slapos_run_entry")
...
...
windows/scripts/slapos-include.sh
View file @
005becea
...
@@ -182,7 +182,7 @@ function reset_slapos_connection()
...
@@ -182,7 +182,7 @@ function reset_slapos_connection()
# ======================================================================
# ======================================================================
function
show_error_exit
()
function
show_error_exit
()
{
{
echo
${
1
-Error
:
run Configure Slapos
failed.
}
echo
${
1
-Error
:
configure SlapOS
failed.
}
read
-n
1
-p
"Press any key to exit..."
read
-n
1
-p
"Press any key to exit..."
exit
1
exit
1
}
# === show_error_exit() === #
}
# === show_error_exit() === #
...
@@ -213,8 +213,9 @@ slapos_request_password()
...
@@ -213,8 +213,9 @@ slapos_request_password()
_password
=
"
${
csih_value
}
"
_password
=
"
${
csih_value
}
"
if
[
-z
"
${
_password
}
"
]
if
[
-z
"
${
_password
}
"
]
then
then
csih_error_multi
"Exiting configuration.
I don't know the password of
${
username
}
."
csih_error_multi
"Exiting configuration.
"
"
I don't know the password of
${
username
}
."
fi
fi
csih_PRIVILEGED_PASSWORD
=
"
${
_password
}
"
}
# === slapos_request_password() === #
}
# === slapos_request_password() === #
# ======================================================================
# ======================================================================
...
...
windows/scripts/slapos-node.sh
View file @
005becea
#! /bin/bash
#! /bin/bash
source
$(
/usr/bin/dirname
$0
)
/slapos-include.sh
source
$(
/usr/bin/dirname
$0
)
/slapos-include.sh
echo
echo
"Start slapos-node script ..."
echo
# -----------------------------------------------------------
# -----------------------------------------------------------
# Check all the configure files
# Check all the configure files
...
@@ -43,5 +46,8 @@ echo "Creating instance ..."
...
@@ -43,5 +46,8 @@ echo "Creating instance ..."
echo
"Sending report ..."
echo
"Sending report ..."
/opt/slapos/bin/slapos node report
--verbose
/opt/slapos/bin/slapos node report
--verbose
echo
echo
"Run slapos-node script successfully."
echo
read
-n
1
-t
60
-p
"Press any key to exit..."
read
-n
1
-t
60
-p
"Press any key to exit..."
exit
0
exit
0
windows/scripts/slapos.iss
View file @
005becea
...
@@ -67,10 +67,10 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D
...
@@ -67,10 +67,10 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D
[Icons]
[Icons]
Name: "{commondesktop}\SlapOS"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{commondesktop}\SlapOS"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\cygtty.bat"; WorkingDir: "{app}\cygwin\opt\slapos"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\cygtty.bat"; WorkingDir: "{app}\cygwin\opt\slapos"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Configure SlapOS"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -h
never -t ""Configure SlapOS Node
"" /etc/slapos/scripts/slapos-configure.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\Configure SlapOS"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -h
error -t ""Configure SlapOS
"" /etc/slapos/scripts/slapos-configure.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\SlapOS Runner"; Filename: "{app}\cygwin\etc\slapos\scripts\slap-runner.html"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\SlapOS Runner"; Filename: "{app}\cygwin\etc\slapos\scripts\slap-runner.html"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\SlapOS"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\SlapOS"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\SlapOS Node"; Filename: "{app}\cygwin\bin\
bash.exe"; Parameters: "--login -i
/etc/slapos/scripts/slapos-node.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\SlapOS Node"; Filename: "{app}\cygwin\bin\
mintty.exe"; Parameters: "-c ~/.minttyrc -h error -t ""SlapOS Node""
/etc/slapos/scripts/slapos-node.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\Uninstall SlapOS"; Filename: "{uninstallexe}";
Name: "{group}\Uninstall SlapOS"; Filename: "{uninstallexe}";
Name: "{group}\User Guide"; Filename: "{app}\user-guide.html";
Name: "{group}\User Guide"; Filename: "{app}\user-guide.html";
...
@@ -81,7 +81,7 @@ Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scrip
...
@@ -81,7 +81,7 @@ Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scrip
Filename: "{app}\cygwin\autorebase.bat"; WorkingDir: "{app}\cygwin"; Flags: skipifdoesntexist runhidden;
Filename: "{app}\cygwin\autorebase.bat"; WorkingDir: "{app}\cygwin"; Flags: skipifdoesntexist runhidden;
[UninstallRun]
[UninstallRun]
Filename: "{app}\cygwin\bin\
bash.exe"; Parameters: "--login -i
/etc/slapos/scripts/pre-uninstall.sh"; WorkingDir: "{app}\cygwin\bin"; Flags: skipifdoesntexist;
Filename: "{app}\cygwin\bin\
mintty.exe"; Parameters: "-c ~/.minttyrc -h never -t ""Uninstall SlapOS""
/etc/slapos/scripts/pre-uninstall.sh"; WorkingDir: "{app}\cygwin\bin"; Flags: skipifdoesntexist;
[UninstallDelete]
[UninstallDelete]
Type: filesandordirs; Name: "{app}\cygwin" ;
Type: filesandordirs; Name: "{app}\cygwin" ;
...
...
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