diff --git a/src/ks-conf b/src/ks-conf index 8a61500..be33f95 100755 --- a/src/ks-conf +++ b/src/ks-conf @@ -723,7 +723,8 @@ while [ ${show_menu} -eq 0 ] ; do echo "" user_config=$(cat ${HOME}/.ks-tools/ks-upload-user 2> /dev/null) server_config=$(cat ${HOME}/.ks-tools/ks-upload-server 2> /dev/null) - echo " u - Edit ks-upv/ks-upa/ks-upf/ks-upr config (${user_config}/${server_config})" + tool_config=$(cat ${HOME}/.ks-tools/ks-upload-tool 2> /dev/null) + echo " u - Edit ks-upv/ks-upa/ks-upf/ks-upr config (${user_config}/${server_config}/${tool_config})" echo "" echo " q - Exit" echo "" diff --git a/src/ks-upa b/src/ks-upa index e1d5c9c..62a0cbc 100755 --- a/src/ks-upa +++ b/src/ks-upa @@ -297,6 +297,11 @@ function showConfig() { echo "- Scan Path (Local): ${showDirLocal}" configAvailable=1 fi + if [ -f ${dirConfig}/ks-upload-tool ] ; then + showUpvTool=$(cat ${dirConfig}/ks-upload-tool) + echo "- Upload Tool: ${showUpvTool}" + configAvailable=1 + fi if [ ${configAvailable} -eq 0 ] ; then echo "* The configuration file does not exist!" fi @@ -322,6 +327,7 @@ function editConfig() { editServer=$(cat ${dirConfig}/ks-upload-server 2> /dev/null) editDirServer=$(cat ${dirConfig}/ks-upload-dirserver 2> /dev/null) editDirLocal=$(cat ${dirConfig}/ks-upload-dirlocal 2> /dev/null) + editUpvTool=$(cat ${dirConfig}/ks-upload-tool 2> /dev/null) echo "" echo "* ks-upa (ks-tools) v${VERSION} (${M_DATE})" echo "" @@ -330,8 +336,9 @@ function editConfig() { echo " 3 - Edit Server (${editServer})" echo " 4 - Edit Dest. Path (${editDirServer})" echo " 5 - Edit Local Path (${editDirLocal})" + echo " 6 - Edit Upload Tool (${editUpvTool})" echo "" - echo " 6 - Exit" + echo " 7 - Exit" echo "" echo -n "* Choose an option: " ; read EDIT echo "" @@ -357,6 +364,14 @@ function editConfig() { dirLocal=${DIR} echo ${dirLocal} > ${dirConfig}/ks-upload-dirlocal elif [ "${EDIT}" == "6" ] ; then + echo -n "* [Default: scp] Type upload tool (scp or rsync): " ; read TOOL + if [ -z "${TOOL}" ] ; then + upvTool="scp" + else + upvTool=${TOOL} + fi + echo ${upvTool} > ${dirConfig}/ks-upload-tool + elif [ "${EDIT}" == "7" ] ; then editConfig=1 else echo "+ Invalid option!" @@ -415,6 +430,12 @@ function createConfig() { dirLocal=${DIR} echo ${dirLocal} > ${dirConfig}/ks-upload-dirlocal fi + # Configure upload tool by default + if [ -f ${dirConfig}/ks-upload-tool ] ; then + echo "+ The UPLOAD TOOL configuration already exists (Use: 'ks-upa -e' for edit)" + else + echo "scp" > ${dirConfig}/ks-upload-tool + fi echo "" } diff --git a/src/ks-upf b/src/ks-upf index 9cb82d6..d5e48cd 100755 --- a/src/ks-upf +++ b/src/ks-upf @@ -315,6 +315,11 @@ function showConfig() { echo "- Scan Path (Local): ${showDirLocal}" configAvailable=1 fi + if [ -f ${dirConfig}/ks-upload-tool ] ; then + showUpvTool=$(cat ${dirConfig}/ks-upload-tool) + echo "- Upload Tool: ${showUpvTool}" + configAvailable=1 + fi if [ ${configAvailable} -eq 0 ] ; then echo "* The configuration file does not exist!" fi @@ -340,6 +345,7 @@ function editConfig() { editServer=$(cat ${dirConfig}/ks-upload-server 2> /dev/null) editDirServer=$(cat ${dirConfig}/ks-upload-dirserver 2> /dev/null) editDirLocal=$(cat ${dirConfig}/ks-upload-dirlocal 2> /dev/null) + editUpvTool=$(cat ${dirConfig}/ks-upload-tool 2> /dev/null) echo "" echo "* ks-upf (ks-tools) v${VERSION} (${M_DATE})" echo "" @@ -348,8 +354,9 @@ function editConfig() { echo " 3 - Edit Server (${editServer})" echo " 4 - Edit Dest. Path (${editDirServer})" echo " 5 - Edit Local Path (${editDirLocal})" + echo " 6 - Edit Upload Tool (${editUpvTool})" echo "" - echo " 6 - Exit" + echo " 7 - Exit" echo "" echo -n "* Choose an option: " ; read EDIT echo "" @@ -374,7 +381,15 @@ function editConfig() { echo -n "* Enter the local path to scan: " ; read DIR dirLocal=${DIR} echo ${dirLocal} > ${dirConfig}/ks-upload-dirlocal - elif [ "${EDIT}" == "6" ] ; then + elif [ "${EDIT}" == "6" ] ; then + echo -n "* [Default: scp] Type upload tool (scp or rsync): " ; read TOOL + if [ -z "${TOOL}" ] ; then + upvTool="scp" + else + upvTool=${TOOL} + fi + echo ${upvTool} > ${dirConfig}/ks-upload-tool + elif [ "${EDIT}" == "7" ] ; then editConfig=1 else echo "+ Invalid option!" @@ -433,6 +448,12 @@ function createConfig() { dirLocal=${DIR} echo ${dirLocal} > ${dirConfig}/ks-upload-dirlocal fi + # Configure upload tool by default + if [ -f ${dirConfig}/ks-upload-tool ] ; then + echo "+ The UPLOAD TOOL configuration already exists (Use: 'ks-upa -e' for edit)" + else + echo "scp" > ${dirConfig}/ks-upload-tool + fi echo "" } diff --git a/src/ks-upr b/src/ks-upr index 9404320..4d4a503 100755 --- a/src/ks-upr +++ b/src/ks-upr @@ -257,6 +257,11 @@ function showConfig() { echo "- Scan Path (Local): ${showDirLocal}" configAvailable=1 fi + if [ -f ${dirConfig}/ks-upload-tool ] ; then + showUpvTool=$(cat ${dirConfig}/ks-upload-tool) + echo "- Upload Tool: ${showUpvTool}" + configAvailable=1 + fi if [ ${configAvailable} -eq 0 ] ; then echo "* The configuration file does not exist!" fi @@ -282,6 +287,7 @@ function editConfig() { editServer=$(cat ${dirConfig}/ks-upload-server 2> /dev/null) editDirServer=$(cat ${dirConfig}/ks-upload-dirserver 2> /dev/null) editDirLocal=$(cat ${dirConfig}/ks-upload-dirlocal 2> /dev/null) + editUpvTool=$(cat ${dirConfig}/ks-upload-tool 2> /dev/null) echo "" echo "* ks-upr (ks-tools) v${VERSION} (${M_DATE})" echo "" @@ -290,8 +296,9 @@ function editConfig() { echo " 3 - Edit Server (${editServer})" echo " 4 - Edit Dest. Path (${editDirServer})" echo " 5 - Edit Local Path (${editDirLocal})" + echo " 6 - Edit Upload Tool (${editUpvTool})" echo "" - echo " 6 - Exit" + echo " 7 - Exit" echo "" echo -n "* Choose an option: " ; read EDIT echo "" @@ -316,7 +323,15 @@ function editConfig() { echo -n "* Enter the local path to scan: " ; read DIR dirLocal=${DIR} echo ${dirLocal} > ${dirConfig}/ks-upload-dirlocal - elif [ "${EDIT}" == "6" ] ; then + elif [ "${EDIT}" == "6" ] ; then + echo -n "* [Default: scp] Type upload tool (scp or rsync): " ; read TOOL + if [ -z "${TOOL}" ] ; then + upvTool="scp" + else + upvTool=${TOOL} + fi + echo ${upvTool} > ${dirConfig}/ks-upload-tool + elif [ "${EDIT}" == "7" ] ; then editConfig=1 else echo "+ Invalid option!" @@ -375,6 +390,12 @@ function createConfig() { dirLocal=${DIR} echo ${dirLocal} > ${dirConfig}/ks-upload-dirlocal fi + # Configure upload tool by default + if [ -f ${dirConfig}/ks-upload-tool ] ; then + echo "+ The UPLOAD TOOL configuration already exists (Use: 'ks-upa -e' for edit)" + else + echo "scp" > ${dirConfig}/ks-upload-tool + fi echo "" } diff --git a/src/ks-upv b/src/ks-upv index f48ad5f..f8727dd 100755 --- a/src/ks-upv +++ b/src/ks-upv @@ -298,6 +298,11 @@ function showConfig() { echo "- Scan Path (Local): ${showDirLocal}" configAvailable=1 fi + if [ -f ${dirConfig}/ks-upload-tool ] ; then + showUpvTool=$(cat ${dirConfig}/ks-upload-tool) + echo "- Upload Tool: ${showUpvTool}" + configAvailable=1 + fi if [ ${configAvailable} -eq 0 ] ; then echo "* The configuration file does not exist!" fi @@ -323,6 +328,7 @@ function editConfig() { editServer=$(cat ${dirConfig}/ks-upload-server 2> /dev/null) editDirServer=$(cat ${dirConfig}/ks-upload-dirserver 2> /dev/null) editDirLocal=$(cat ${dirConfig}/ks-upload-dirlocal 2> /dev/null) + editUpvTool=$(cat ${dirConfig}/ks-upload-tool 2> /dev/null) echo "" echo "* ks-upv (ks-tools) v${VERSION} (${M_DATE})" echo "" @@ -331,8 +337,9 @@ function editConfig() { echo " 3 - Edit Server (${editServer})" echo " 4 - Edit Dest. Path (${editDirServer})" echo " 5 - Edit Local Path (${editDirLocal})" + echo " 6 - Edit Upload Tool (${editUpvTool})" echo "" - echo " 6 - Exit" + echo " 7 - Exit" echo "" echo -n "* Choose an option: " ; read EDIT echo "" @@ -357,7 +364,15 @@ function editConfig() { echo -n "* Enter the local path to scan: " ; read DIR dirLocal=${DIR} echo ${dirLocal} > ${dirConfig}/ks-upload-dirlocal - elif [ "${EDIT}" == "6" ] ; then + elif [ "${EDIT}" == "6" ] ; then + echo -n "* [Default: scp] Type upload tool (scp or rsync): " ; read TOOL + if [ -z "${TOOL}" ] ; then + upvTool="scp" + else + upvTool=${TOOL} + fi + echo ${upvTool} > ${dirConfig}/ks-upload-tool + elif [ "${EDIT}" == "7" ] ; then editConfig=1 else echo "+ Invalid option!" @@ -416,6 +431,12 @@ function createConfig() { dirLocal=${DIR} echo ${dirLocal} > ${dirConfig}/ks-upload-dirlocal fi + # Configure upload tool by default + if [ -f ${dirConfig}/ks-upload-tool ] ; then + echo "+ The UPLOAD TOOL configuration already exists (Use: 'ks-upa -e' for edit)" + else + echo "scp" > ${dirConfig}/ks-upload-tool + fi echo "" }