Setting scp-pem as default when select certificate (ks-upv/upa/upf/upr)

This commit is contained in:
q3aql 2023-03-12 19:01:23 +01:00
parent 5c384a0350
commit 8c39912218
4 changed files with 36 additions and 12 deletions

View File

@ -690,6 +690,7 @@ function createConfig() {
echo ${encrypt_password_enter} > ${dirConfig}/ks-upload-pass
cp -rf "${pem_path}" ${dirConfig}/connect.pem
chmod 600 ${dirConfig}/connect.pem
echo "scp-pem" > ${dirConfig}/ks-upload-tool
echo "* PEM file copied to ${dirConfig}/connect.pem"
else
echo "+ File ${pem_path} does not exist"
@ -706,7 +707,7 @@ function createConfig() {
if [ -f ${dirConfig}/ks-upload-server ] ; then
echo "+ The SERVER configuration already exists (Use: 'ks-upa -e' for edit)"
else
echo -n "* Enter the server URL: " ; read SERVER
echo -n "* Enter the server URL (or IP): " ; read SERVER
server=${SERVER}
echo ${server} > ${dirConfig}/ks-upload-server
fi
@ -730,8 +731,13 @@ function createConfig() {
if [ -f ${dirConfig}/ks-upload-tool ] ; then
echo "+ The UPLOAD TOOL configuration already exists (Use: 'ks-upa -e' for edit)"
else
echo "* Setting 'scp' as the default tool"
echo "scp" > ${dirConfig}/ks-upload-tool
if [ "${PASS}" == "pem" ] ; then
echo "* Setting 'scp-pem' as the default tool"
echo "scp-pem" > ${dirConfig}/ks-upload-tool
else
echo "* Setting 'scp' as the default tool"
echo "scp" > ${dirConfig}/ks-upload-tool
fi
fi
# Configure port by default
if [ -f ${dirConfig}/ks-upload-port ] ; then

View File

@ -717,6 +717,7 @@ function createConfig() {
echo ${encrypt_password_enter} > ${dirConfig}/ks-upload-pass
cp -rf "${pem_path}" ${dirConfig}/connect.pem
chmod 600 ${dirConfig}/connect.pem
echo "scp-pem" > ${dirConfig}/ks-upload-tool
echo "* PEM file copied to ${dirConfig}/connect.pem"
else
echo "+ File ${pem_path} does not exist"
@ -733,7 +734,7 @@ function createConfig() {
if [ -f ${dirConfig}/ks-upload-server ] ; then
echo "+ The SERVER configuration already exists (Use: 'ks-upf -e' for edit)"
else
echo -n "* Enter the server URL: " ; read SERVER
echo -n "* Enter the server URL (or IP): " ; read SERVER
server=${SERVER}
echo ${server} > ${dirConfig}/ks-upload-server
fi
@ -757,8 +758,13 @@ function createConfig() {
if [ -f ${dirConfig}/ks-upload-tool ] ; then
echo "+ The UPLOAD TOOL configuration already exists (Use: 'ks-upf -e' for edit)"
else
echo "* Setting 'scp' as the default tool"
echo "scp" > ${dirConfig}/ks-upload-tool
if [ "${PASS}" == "pem" ] ; then
echo "* Setting 'scp-pem' as the default tool"
echo "scp-pem" > ${dirConfig}/ks-upload-tool
else
echo "* Setting 'scp' as the default tool"
echo "scp" > ${dirConfig}/ks-upload-tool
fi
fi
# Configure port by default
if [ -f ${dirConfig}/ks-upload-port ] ; then

View File

@ -576,6 +576,7 @@ function createConfig() {
echo ${encrypt_password_enter} > ${dirConfig}/ks-upload-pass
cp -rf "${pem_path}" ${dirConfig}/connect.pem
chmod 600 ${dirConfig}/connect.pem
echo "scp-pem" > ${dirConfig}/ks-upload-tool
echo "* PEM file copied to ${dirConfig}/connect.pem"
else
echo "+ File ${pem_path} does not exist"
@ -592,7 +593,7 @@ function createConfig() {
if [ -f ${dirConfig}/ks-upload-server ] ; then
echo "+ The SERVER configuration already exists (Use: 'ks-upr -e' for edit)"
else
echo -n "* Enter the server URL: " ; read SERVER
echo -n "* Enter the server URL (or IP): " ; read SERVER
server=${SERVER}
echo ${server} > ${dirConfig}/ks-upload-server
fi
@ -616,8 +617,13 @@ function createConfig() {
if [ -f ${dirConfig}/ks-upload-tool ] ; then
echo "+ The UPLOAD TOOL configuration already exists (Use: 'ks-upr -e' for edit)"
else
echo "* Setting 'scp' as the default tool"
echo "scp" > ${dirConfig}/ks-upload-tool
if [ "${PASS}" == "pem" ] ; then
echo "* Setting 'scp-pem' as the default tool"
echo "scp-pem" > ${dirConfig}/ks-upload-tool
else
echo "* Setting 'scp' as the default tool"
echo "scp" > ${dirConfig}/ks-upload-tool
fi
fi
# Configure port by default
if [ -f ${dirConfig}/ks-upload-port ] ; then

View File

@ -690,6 +690,7 @@ function createConfig() {
echo ${encrypt_password_enter} > ${dirConfig}/ks-upload-pass
cp -rf "${pem_path}" ${dirConfig}/connect.pem
chmod 600 ${dirConfig}/connect.pem
echo "scp-pem" > ${dirConfig}/ks-upload-tool
echo "* PEM file copied to ${dirConfig}/connect.pem"
else
echo "+ File ${pem_path} does not exist"
@ -706,7 +707,7 @@ function createConfig() {
if [ -f ${dirConfig}/ks-upload-server ] ; then
echo "+ The SERVER configuration already exists (Use: 'ks-upv -e' for edit)"
else
echo -n "* Enter the server URL: " ; read SERVER
echo -n "* Enter the server URL (or IP): " ; read SERVER
server=${SERVER}
echo ${server} > ${dirConfig}/ks-upload-server
fi
@ -730,8 +731,13 @@ function createConfig() {
if [ -f ${dirConfig}/ks-upload-tool ] ; then
echo "+ The UPLOAD TOOL configuration already exists (Use: 'ks-upv -e' for edit)"
else
echo "* Setting 'scp' as the default tool"
echo "scp" > ${dirConfig}/ks-upload-tool
if [ "${PASS}" == "pem" ] ; then
echo "* Setting 'scp-pem' as the default tool"
echo "scp-pem" > ${dirConfig}/ks-upload-tool
else
echo "* Setting 'scp' as the default tool"
echo "scp" > ${dirConfig}/ks-upload-tool
fi
fi
# Configure port by default
if [ -f ${dirConfig}/ks-upload-port ] ; then