Commit c241caf1 authored by Jondy Zhao's avatar Jondy Zhao

Fix suffix of template file name

parent 02439eed
...@@ -11,19 +11,20 @@ slapos_client_home=~/.slapos ...@@ -11,19 +11,20 @@ slapos_client_home=~/.slapos
client_configure_file=$slapos_client_home/slapos.cfg client_configure_file=$slapos_client_home/slapos.cfg
client_certificate_file=$slapos_client_home/certificate client_certificate_file=$slapos_client_home/certificate
client_key_file=$slapos_client_home/key client_key_file=$slapos_client_home/key
template_configure_file=/etc/slapos/slapos-client.cfg.example
mkdir -p $slapos_client_home mkdir -p $slapos_client_home
# #
# Generate desktop configure file # Generate desktop configure file
# #
echo echo
echo Before continue to configure, make sure you have an account in the 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 slapos.org community, and have obtained X509 certificate and key
echo which are needed for the following configuration process. echo which are needed for the following configuration process.
echo echo
echo Refer to http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/developer-Installing.SlapOS.Client echo Refer to http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/developer-Installing.SlapOS.Client
echo echo
if [[ -f "$1" ]] ; then if [[ -f "$1" ]] ; then
echo "Copy certificate from $2 to $client_certificate_file" echo "Copy certificate from $2 to $client_certificate_file"
...@@ -33,7 +34,7 @@ elif [[ ! -f $client_certificate_file ]] ; then ...@@ -33,7 +34,7 @@ elif [[ ! -f $client_certificate_file ]] ; then
[[ ! -f "$certificate_file" ]] && \ [[ ! -f "$certificate_file" ]] && \
echo "Certificate file %s doesn't exists." && exit 1 echo "Certificate file %s doesn't exists." && exit 1
echo "Copy certificate from $certificate_file to $client_certificate_file" echo "Copy certificate from $certificate_file to $client_certificate_file"
cp $certificate_file $client_certificate_file cp $certificate_file $client_certificate_file
fi fi
if [[ -f "$2" ]] ; then if [[ -f "$2" ]] ; then
...@@ -44,14 +45,14 @@ elif [[ ! -f $client_key_file ]] ; then ...@@ -44,14 +45,14 @@ elif [[ ! -f $client_key_file ]] ; then
[[ ! -f "$key_file" ]] && \ [[ ! -f "$key_file" ]] && \
echo "Key file %s doesn't exists." && exit 1 echo "Key file %s doesn't exists." && exit 1
echo "Copy key from $key_file to $client_key_file" echo "Copy key from $key_file to $client_key_file"
cp $key_file $client_key_file cp $key_file $client_key_file
fi fi
if [[ ! -f $client_configure_file ]] ; then if [[ ! -f $client_configure_file ]] ; then
[[ -f /etc/slapos/slapos-client.cfg.sample ]] || \ [[ -f $template_configure_file ]] || \
(cd /etc/slapos; wget -O slapos.cfg http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/slapos-client.cfg.example) || \ (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) (echo "Download slapos-client.cfg.example failed."; exit 1)
cp /etc/slapos/slapos.cfg.sample $client_configure_file cp $template_configure_file $client_configure_file
fi fi
sed -i -e "s/^cert_file.*$/cert_file = $client_certificate_file/" \ sed -i -e "s/^cert_file.*$/cert_file = $client_certificate_file/" \
......
...@@ -153,11 +153,11 @@ mkdir -p /etc/opt/slapos/ssl/partition_pki ...@@ -153,11 +153,11 @@ mkdir -p /etc/opt/slapos/ssl/partition_pki
nodecfgfile=/etc/opt/slapos/slapos.cfg nodecfgfile=/etc/opt/slapos/slapos.cfg
if [[ ! -f $nodecfgfile ]] ; then if [[ ! -f $nodecfgfile ]] ; then
[[ -f /etc/slapos/slapos.cfg.sample ]] || \ [[ -f /etc/slapos/slapos.cfg.example ]] || \
(cd /etc/slapos; wget -O slapos.cfg http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/slapos.cfg.example) || \ (cd /etc/slapos; wget -O slapos.cfg http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/slapos.cfg.example) || \
(echo "Download slapos.cfg.example failed."; exit 1) (echo "Download slapos.cfg.example failed."; exit 1)
cp /etc/slapos/slapos.cfg.sample $nodecfgfile cp /etc/slapos/slapos.cfg.example $nodecfgfile
fi fi
interface_guid=$(connection2guid re6stnet-lo) interface_guid=$(connection2guid re6stnet-lo)
......
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