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
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.package
Commits
f11575b5
Commit
f11575b5
authored
May 02, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the directory of installed files in the setup scripts
parent
ccc6348b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
186 additions
and
28 deletions
+186
-28
windows/scripts/register-node.sh
windows/scripts/register-node.sh
+158
-0
windows/scripts/slapos-all-in-one.iss
windows/scripts/slapos-all-in-one.iss
+16
-16
windows/scripts/slapos.iss
windows/scripts/slapos.iss
+12
-12
No files found.
windows/scripts/register-node.sh
0 → 100755
View file @
f11575b5
#! /bin/bash
#
#------------------------------------------------------------------------------
# Copyright (c) 2010, 2011, 2012 Vifib SARL and Contributors.
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#------------------------------------------------------------------------------
#
# Run this script need the administrator priviledge.
#
# return GUID of physical netcard only
#
# Get the value of Characteristics of each interface,
#
# Characteristics & NCF_VIRTUAL == NCF_VIRTUAL
# Characteristics & NCF_PHYSICAL == NCF_PHYSICAL
#
function
get_all_physical_netcard
()
{
local
-r
NCF_VIRTUAL
=
1
local
-r
NCF_PHYSICAL
=
4
local
-r
NCF_HIDDEN
=
8
local
-r
NCF_HAS_UI
=
0x80
local
-r
NCF_EXPECTED
=
$((
NCF_PHYSICAL
|
NCF_HAS_UI
))
key
=
'\HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}'
for
subkey
in
$(
regtool
-q
list
"
$key
"
)
;
do
local
-i
flags
=
$(
regtool
-q
get
"
$key
\\
$subkey
\C
haracteristics"
)
if
((
(
flags & NCF_EXPECTED
)
==
NCF_EXPECTED
))
;
then
regtool
-q
get
"
$key
\\
$subkey
\N
etCfgInstanceId"
&&
return
0
fi
done
}
# get connection name by IF_GUID
function
get_connection_name
()
{
key
=
'\HKLM\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002bE10318}'
echo
$(
regtool
-q
get
"
$key
\\
$IF_GUID
\C
onnection
\N
ame"
)
}
#
# Tell by getmac, if GUID can be found, it's ok, else disabled or not connected
function
get_interface_state
()
{
getmac /V /FO list |
grep
"
${
INTERFACENAME
}
"
return
$?
}
# test code
# slist=$(get_all_physical_netcard)
# echo physical netcards: $slist
# for s in $slist ; do
# INTERFACE_NAME=$s
# echo conn name is $(get_connection_name)
# done
# get_local_ip_version
# echo version is $local_ip_version
# exit 0
if
[[
!
$(
whoami
)
==
Administrator
]]
;
then
echo
"Error: only administrator can run this script."
exit
1
fi
if
[[
!
-d
~/.slapos
]]
;
then
echo
"INFO: mkdir ~/.slapos"
mkdir
~/.slapos
fi
if
[[
!
(
-f
~/.slapos/certificate
&&
-f
~/.slapos/key
)
]]
;
then
echo
"Error: missing certificate and key in the ~/.slapos
\
If you haven't an account in the slapos.org, please login https://www.slapos.org and signup. Otherwise to be sure both of files are stored in the ~/.slapos
"
exit
1
fi
if
[[
!
-f
~/.slapos/slapos.cfg
]]
;
then
echo
"INFO: generate configure file '~/.slapos/slapos.cfg'"
echo
"[slapos]
master_url = https://slap.vifib.com/
[slapconsole]
# Put here retrieved certificate from vifib.
# Beware: put certificate from YOUR account, not the one from your node.
# You (as identified person from vifib) will request an instance, node your node.
# Conclusion: node certificate != person certificate.
cert_file = ~/.slapos/certificate
key_file = ~/.slapos/key
# Below are softwares supported by Vifib
alias =
"
>
~/.slapos/slapos.cfg
fi
# Remove startup item first.
RUNKEY
=
'\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
SLAPOSNODEINIT
=
SlapOS-Node
regtool
-q
unset
"
$RUNKEY
\\
$SLAPOSNODEINIT
"
nodename
=
$(
hostname
)
cd
/opt/slapos
bin/slapos node register
$nodename
# Check computer configure file: /etc/opt/slapos/slapos.cfg
nodecfg
=
/etc/opt/slapos/slapos.cfg
if
[[
!
-f
$nodecfg
]]
;
then
echo
Error: something is wrong when register node. Can not find the configure file
$nodecfg
.
exit
1
fi
# check ipv6
netsh interface ipv6 show interface
>
/dev/null
||
netsh interface ipv6
install
# get GUID of the first physics netcard
guidname
=
get_all_physical_netcard
if
[[
"
$guidname
"
==
""
]]
;
then
echo
Error: no any physical netcard found.
exit
1
fi
#
# Replace interface_name in the configure name
#
# generate /etc/slapos/slapos.cfg
sed
-i
-e
"s/^
\\
s*interface_name.*
$/
interface_name =
${
IPINTERFACE
}
/g"
\
-e
"s/^#
\?\\
s*ipv6_interface.*
$/
# ipv6_interface =/g"
\
$nodecfg
#
# Add run item when windows startup
echo
Set slapos init script as Windows startup item.
regtool
-q
set
"
$RUNKEY
\\
$SLAPOSNODEINIT
"
"
\"
$(
cygpath
-w
/usr/bin/sh
)
\"
--login -i /etc/slapos/scripts/init-slapos-node.sh"
((
$?
))
&&
echo
Fail to
set
init script as startup item.
windows/scripts/slapos-all-in-one.iss
View file @
f11575b5
...
@@ -22,7 +22,10 @@ Name: "{app}\cygwin\etc\slapos\scripts"
...
@@ -22,7 +22,10 @@ Name: "{app}\cygwin\etc\slapos\scripts"
Source: "cygwin-packages\*"; DestDir: "{app}\cygwin-packages"; Flags: recursesubdirs;
Source: "cygwin-packages\*"; DestDir: "{app}\cygwin-packages"; Flags: recursesubdirs;
Source: "publish\buildout\slapos\*"; DestDir: "{app}\cygwin\opt\slapos"; Flags: recursesubdirs;
Source: "publish\buildout\slapos\*"; DestDir: "{app}\cygwin\opt\slapos"; Flags: recursesubdirs;
Source: "opt\git\re6stnet\dist\re6stnet-0.1.tar.gz"; DestDir: "{app}\cygwin"; DestName: "re6stnet.tar.gz"; Flags: deleteafterinstall;
Source: "opt\git\slapos\component\cygwin\slapos-core.patch"; DestDir: "{app}\cygwin\etc\slapos\patches";
Source: "opt\git\slapos\component\cygwin\slapos-cookbook-inotifyx.patch"; DestDir: "{app}\cygwin\etc\slapos\patches";
Source: "opt\git\re6stnet\dist\re6stnet-0.1.tar.gz"; DestDir: "{app}\cygwin"; DestName: "re6stnet-0.1.tar.gz"; Flags: deleteafterinstall;
Source: "opt\downloads\miniupnpc-1.8.tar.gz"; DestDir: "{app}\cygwin"; DestName: "miniupnpc.tar.gz"; Flags: deleteafterinstall;
Source: "opt\downloads\miniupnpc-1.8.tar.gz"; DestDir: "{app}\cygwin"; DestName: "miniupnpc.tar.gz"; Flags: deleteafterinstall;
Source: "opt\git\slapos.recipe.cmmi\dist\slapos.recipe.cmmi-0.1.tar.gz"; DestDir: "{app}\opt\download-cache\dist";
Source: "opt\git\slapos.recipe.cmmi\dist\slapos.recipe.cmmi-0.1.tar.gz"; DestDir: "{app}\opt\download-cache\dist";
...
@@ -35,15 +38,12 @@ Source: "images\register.ico"; DestDir: "{app}\images";
...
@@ -35,15 +38,12 @@ Source: "images\register.ico"; DestDir: "{app}\images";
Source: "images\updater.ico"; DestDir: "{app}\images";
Source: "images\updater.ico"; DestDir: "{app}\images";
Source: "images\manager.ico"; DestDir: "{app}\images";
Source: "images\manager.ico"; DestDir: "{app}\images";
Source: "src\setup-cygwin.bat"; DestDir: "{app}";
Source: "opt\git\slapos.package\windows\scripts\ip"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "setup.exe"; DestDir: "{app}\cygwin-packages";
Source: "opt\git\slapos.package\windows\scripts\useradd"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\usermod"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "src\win32\ip"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\groupadd"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "src\win32\useradd"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\brctl"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "src\win32\usermod"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\tunctl"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "src\win32\groupadd"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "src\win32\brctl"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "src\win32\tunctl"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\usr\local\bin";
...
@@ -51,14 +51,14 @@ Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe";
...
@@ -51,14 +51,14 @@ Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe";
Source: "src\docs\openvpn\devcon.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "src\docs\openvpn\devcon.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "src\docs\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver";
Source: "src\docs\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver";
Source: "
src\win32
\init-slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
opt\git\slapos.package\windows\scripts
\init-slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
src\win32
\init-cygwin.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
opt\git\slapos.package\windows\scripts
\init-cygwin.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
src\win32
\build-slapos.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
opt\git\slapos.package\windows\scripts
\build-slapos.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
src\win32
\init-re6stnet.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
opt\git\slapos.package\windows\scripts
\init-re6stnet.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
src\win32
\build-slapos.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
opt\git\slapos.package\windows\scripts
\build-slapos.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "src\docs\using-slapos-in-windows.html"; DestDir: "{app}"; DestName: "user-guide.html";
Source: "src\docs\using-slapos-in-windows.html"; DestDir: "{app}"; DestName: "user-guide.html";
Source: "src\
win32
\README.cygwin"; DestDir: "{app}"; DestName: "readme.txt";
Source: "src\
docs
\README.cygwin"; DestDir: "{app}"; DestName: "readme.txt";
[Icons]
[Icons]
Name: "{commondesktop}\SlapOS"; Filename: "{app}\cygwin\etc\slapos\desktop\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\desktop"; IconFilename: "{app}\imapges\slapos.ico";
Name: "{commondesktop}\SlapOS"; Filename: "{app}\cygwin\etc\slapos\desktop\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\desktop"; IconFilename: "{app}\imapges\slapos.ico";
...
...
windows/scripts/slapos.iss
View file @
f11575b5
...
@@ -37,12 +37,12 @@ Source: "images\register.ico"; DestDir: "{app}\images";
...
@@ -37,12 +37,12 @@ Source: "images\register.ico"; DestDir: "{app}\images";
Source: "images\updater.ico"; DestDir: "{app}\images";
Source: "images\updater.ico"; DestDir: "{app}\images";
Source: "images\manager.ico"; DestDir: "{app}\images";
Source: "images\manager.ico"; DestDir: "{app}\images";
Source: "
src\win32
\ip"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "
opt\git\slapos.package\windows\scripts
\ip"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "
src\win32
\useradd"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "
opt\git\slapos.package\windows\scripts
\useradd"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "
src\win32
\usermod"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "
opt\git\slapos.package\windows\scripts
\usermod"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "
src\win32
\groupadd"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "
opt\git\slapos.package\windows\scripts
\groupadd"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "
src\win32
\brctl"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "
opt\git\slapos.package\windows\scripts
\brctl"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "
src\win32
\tunctl"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "
opt\git\slapos.package\windows\scripts
\tunctl"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\babeld\babeld.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe"; DestDir: "{app}\cygwin\usr\local\bin";
...
@@ -50,14 +50,14 @@ Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe";
...
@@ -50,14 +50,14 @@ Source: "opt\git\slapos.package\windows\openvpn\src\openvpn\.libs\openvpn.exe";
Source: "src\docs\openvpn\devcon.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "src\docs\openvpn\devcon.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "src\docs\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver";
Source: "src\docs\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver";
Source: "
src\win32
\init-slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
opt\git\slapos.package\windows\scripts
\init-slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
src\win32
\init-cygwin.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
opt\git\slapos.package\windows\scripts
\init-cygwin.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
src\win32
\build-slapos.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
opt\git\slapos.package\windows\scripts
\build-slapos.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
src\win32
\init-re6stnet.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
opt\git\slapos.package\windows\scripts
\init-re6stnet.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
src\win32
\build-slapos.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "
opt\git\slapos.package\windows\scripts
\build-slapos.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "src\docs\using-slapos-in-windows.html"; DestDir: "{app}"; DestName: "user-guide.html";
Source: "src\docs\using-slapos-in-windows.html"; DestDir: "{app}"; DestName: "user-guide.html";
Source: "src\
win32
\README.cygwin"; DestDir: "{app}"; DestName: "readme.txt";
Source: "src\
docs
\README.cygwin"; DestDir: "{app}"; DestName: "readme.txt";
[Icons]
[Icons]
Name: "{commondesktop}\SlapOS"; Filename: "{app}\cygwin\etc\slapos\desktop\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\desktop"; IconFilename: "{app}\imapges\slapos.ico";
Name: "{commondesktop}\SlapOS"; Filename: "{app}\cygwin\etc\slapos\desktop\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\desktop"; IconFilename: "{app}\imapges\slapos.ico";
...
...
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