Commit e5566533 authored by Jondy Zhao's avatar Jondy Zhao

Add slapos-client-config.sh

parent 1e57b55e
...@@ -38,10 +38,13 @@ Source: "opt\git\slapos.package\windows\scripts\setup-cygwin.bat"; DestDir: "{ap ...@@ -38,10 +38,13 @@ Source: "opt\git\slapos.package\windows\scripts\setup-cygwin.bat"; DestDir: "{ap
Source: "cygwin\Cygwin-Terminal.ico"; DestDir: "{app}\images"; DestName: "terminal.ico"; Source: "cygwin\Cygwin-Terminal.ico"; DestDir: "{app}\images"; DestName: "terminal.ico";
Source: "images\configure.ico"; DestDir: "{app}\images"; Source: "images\configure.ico"; DestDir: "{app}\images";
Source: "images\register.ico"; DestDir: "{app}\images"; Source: "images\node.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: "setup.exe"; DestDir: "{app}";
Source: "opt\git\slapos.package\windows\scripts\setup-cygwin.bat"; DestDir: "{app}";
Source: "opt\git\slapos.package\windows\scripts\ip"; DestDir: "{app}\cygwin\usr\local\bin"; Source: "opt\git\slapos.package\windows\scripts\ip"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\git\slapos.package\windows\scripts\useradd"; DestDir: "{app}\cygwin\usr\local\bin"; 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: "opt\git\slapos.package\windows\scripts\usermod"; DestDir: "{app}\cygwin\usr\local\bin";
...@@ -59,6 +62,7 @@ Source: "opt\git\slapos.package\windows\scripts\init-slapos-node.sh"; DestDir: " ...@@ -59,6 +62,7 @@ Source: "opt\git\slapos.package\windows\scripts\init-slapos-node.sh"; DestDir: "
Source: "opt\git\slapos.package\windows\scripts\post-install.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts"; Source: "opt\git\slapos.package\windows\scripts\post-install.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\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: "opt\git\slapos.package\windows\scripts\slapos-node-config.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts"; Source: "opt\git\slapos.package\windows\scripts\slapos-node-config.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\slapos-client-config.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\docs\README.cygwin"; DestDir: "{app}"; DestName: "readme.txt"; Source: "src\docs\README.cygwin"; DestDir: "{app}"; DestName: "readme.txt";
...@@ -67,7 +71,8 @@ Source: "src\docs\README.cygwin"; DestDir: "{app}"; DestName: "readme.txt"; ...@@ -67,7 +71,8 @@ Source: "src\docs\README.cygwin"; DestDir: "{app}"; DestName: "readme.txt";
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";
Name: "{group}\SlapOS"; Filename: "{app}\cygwin\etc\slapos\desktop\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\desktop"; IconFilename: "{app}\imapges\slapos.ico"; Name: "{group}\SlapOS"; Filename: "{app}\cygwin\etc\slapos\desktop\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\desktop"; IconFilename: "{app}\imapges\slapos.ico";
Name: "{group}\Node Manager"; Filename: "{app}\cygwin\etc\slapos\node\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\node"; IconFilename: "{app}\imapges\manager.ico"; Name: "{group}\Node Manager"; Filename: "{app}\cygwin\etc\slapos\node\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\node"; IconFilename: "{app}\imapges\manager.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}\imapges\register.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}\imapges\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}\imapges\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}\imapges\terminal.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}\imapges\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}\imapges\updater.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}\imapges\updater.ico";
Name: "{group}\User Guide"; Filename: "{app}\user-guide.html"; Name: "{group}\User Guide"; Filename: "{app}\user-guide.html";
......
#! /bin/bash
#
# Configure slapos desktop,
#
# Usage:
#
# ./slapos-client-config
#
slapos_client_home=~/.slapos
client_configure_file=$slapos_client_home/slapos.cfg
client_certificate_file=$slapos_client_home/certificate
client_key_file=$slapos_client_home/key
mkdir -p $slapos_client_home
#
# Generate desktop configure file
#
echo
echo Before continue to configure, make sure you have an account in the
echo slapos.org community, and have obtained X509 certificate and key
echo which are needed for the following configuration process.
echo
echo Refer to http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/developer-Installing.SlapOS.Client
echo
if [[ -f "$1" ]] ; then
echo "Copy certificate from $2 to $client_certificate_file"
cp $1 $client_certificate_file
elif [[ ! -f $client_certificate_file ]] ; then
read -p "Where is certificate file: " certificate_file
[[ ! -f "$certificate_file" ]] && \
echo "Certificate file %s doesn't exists." && exit 1
echo "Copy certificate from $certificate_file to $client_certificate_file"
cp $certificate_file $client_certificate_file
fi
if [[ -f "$2" ]] ; then
echo "Copy key from $3 to $client_key_file"
cp $2 $client_key_file
elif [[ ! -f $client_key_file ]] ; then
read -p "Where is key file: " key_file
[[ ! -f "$key_file" ]] && \
echo "Key file %s doesn't exists." && exit 1
echo "Copy key from $key_file to $client_key_file"
cp $key_file $client_key_file
fi
if [[ ! -f $client_configure_file ]] ; then
[[ -f /etc/slapos/slapos-client.cfg.sample ]] || \
(cd /etc/slapos; wget -O slapos.cfg http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/slapos-client.cfg.example) || \
(echo "Download slapos-client.cfg.example failed."; exit 1)
cp /etc/slapos/slapos.cfg.sample $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
...@@ -32,7 +32,7 @@ Source: "opt\git\qooxdoo\application\showcase\build\*"; DestDir: "{app}\cygwin\e ...@@ -32,7 +32,7 @@ Source: "opt\git\qooxdoo\application\showcase\build\*"; DestDir: "{app}\cygwin\e
Source: "cygwin\Cygwin-Terminal.ico"; DestDir: "{app}\images"; DestName: "terminal.ico"; Source: "cygwin\Cygwin-Terminal.ico"; DestDir: "{app}\images"; DestName: "terminal.ico";
Source: "images\configure.ico"; DestDir: "{app}\images"; Source: "images\configure.ico"; DestDir: "{app}\images";
Source: "images\register.ico"; DestDir: "{app}\images"; Source: "images\node.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";
...@@ -56,6 +56,7 @@ Source: "opt\git\slapos.package\windows\scripts\init-slapos-node.sh"; DestDir: " ...@@ -56,6 +56,7 @@ Source: "opt\git\slapos.package\windows\scripts\init-slapos-node.sh"; DestDir: "
Source: "opt\git\slapos.package\windows\scripts\post-install.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts"; Source: "opt\git\slapos.package\windows\scripts\post-install.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\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: "opt\git\slapos.package\windows\scripts\slapos-node-config.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts"; Source: "opt\git\slapos.package\windows\scripts\slapos-node-config.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\slapos-client-config.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\docs\README.cygwin"; DestDir: "{app}"; DestName: "readme.txt"; Source: "src\docs\README.cygwin"; DestDir: "{app}"; DestName: "readme.txt";
...@@ -64,7 +65,8 @@ Source: "src\docs\README.cygwin"; DestDir: "{app}"; DestName: "readme.txt"; ...@@ -64,7 +65,8 @@ Source: "src\docs\README.cygwin"; DestDir: "{app}"; DestName: "readme.txt";
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";
Name: "{group}\SlapOS"; Filename: "{app}\cygwin\etc\slapos\desktop\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\desktop"; IconFilename: "{app}\imapges\slapos.ico"; Name: "{group}\SlapOS"; Filename: "{app}\cygwin\etc\slapos\desktop\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\desktop"; IconFilename: "{app}\imapges\slapos.ico";
Name: "{group}\Node Manager"; Filename: "{app}\cygwin\etc\slapos\node\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\node"; IconFilename: "{app}\imapges\manager.ico"; Name: "{group}\Node Manager"; Filename: "{app}\cygwin\etc\slapos\node\index.html"; WorkingDir: "{app}\cygwin\etc\slapos\node"; IconFilename: "{app}\imapges\manager.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}\imapges\register.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}\imapges\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}\imapges\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}\imapges\terminal.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}\imapges\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}\imapges\updater.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}\imapges\updater.ico";
Name: "{group}\User Guide"; Filename: "{app}\user-guide.html"; Name: "{group}\User Guide"; Filename: "{app}\user-guide.html";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment