Show message if you use scp
This commit is contained in:
parent
d2e28f22e6
commit
ef0ca8219e
14
src/ks-upa
14
src/ks-upa
|
@ -139,9 +139,7 @@ function sendFile() {
|
||||||
# Run command for upload on Windows (Cygwin)
|
# Run command for upload on Windows (Cygwin)
|
||||||
if [ "${cygwin}" == "yes" ] ; then
|
if [ "${cygwin}" == "yes" ] ; then
|
||||||
if [ "${toolSelected}" == "rsync" ] ; then
|
if [ "${toolSelected}" == "rsync" ] ; then
|
||||||
comandOne="/usr/bin/sshpass -p ${1} /usr/bin/rsync -azL -e"
|
/usr/bin/rsync --progress -azL --rsh="/usr/bin/sshpass -p ${1} /usr/bin/ssh -l ${3}" ${2} ${4}:${5} 2> /dev/null
|
||||||
comandTwo="--progress ${2} ${3}@${4}:${5}"
|
|
||||||
${comandOne} "/usr/bin/ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" ${comandTwo} 2> /dev/null
|
|
||||||
/usr/bin/sshpass -p ${1} /usr/bin/ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
/usr/bin/sshpass -p ${1} /usr/bin/ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
||||||
OUTPUT=$?
|
OUTPUT=$?
|
||||||
else
|
else
|
||||||
|
@ -151,9 +149,7 @@ function sendFile() {
|
||||||
# Run command for upload on Unix systems
|
# Run command for upload on Unix systems
|
||||||
else
|
else
|
||||||
if [ "${toolSelected}" == "rsync" ] ; then
|
if [ "${toolSelected}" == "rsync" ] ; then
|
||||||
comandOne="sshpass -p ${1} rsync -azL -e"
|
rsync --progress -azL --rsh="sshpass -p ${1} ssh -l ${3}" ${2} ${4}:${5} 2> /dev/null
|
||||||
comandTwo="--progress ${2} ${3}@${4}:${5}"
|
|
||||||
${comandOne} "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" ${comandTwo} 2> /dev/null
|
|
||||||
sshpass -p ${1} ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
sshpass -p ${1} ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
||||||
OUTPUT=$?
|
OUTPUT=$?
|
||||||
else
|
else
|
||||||
|
@ -628,6 +624,12 @@ elif [ "${1}" == "-i" ] ; then
|
||||||
count=1
|
count=1
|
||||||
echo "+ ${totalFiles} audio file(s) found!"
|
echo "+ ${totalFiles} audio file(s) found!"
|
||||||
echo ""
|
echo ""
|
||||||
|
current_tool=$(cat ${dirConfig}/ks-upload-tool)
|
||||||
|
if [ "${current_tool}" == "scp" ] ; then
|
||||||
|
echo "* NOTE: You are using 'scp' to upload files and no progress will be shown."
|
||||||
|
echo "* IMPORTANT: It's possible switch to 'rsync' if you wish (Command: ks-upv -e)"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
while [ ${count} -le ${totalFiles} ] ; do
|
while [ ${count} -le ${totalFiles} ] ; do
|
||||||
fullNameFile=$(showFile ${count})
|
fullNameFile=$(showFile ${count})
|
||||||
fullPathFile=$(showPathFile ${count})
|
fullPathFile=$(showPathFile ${count})
|
||||||
|
|
14
src/ks-upf
14
src/ks-upf
|
@ -157,9 +157,7 @@ function sendFile() {
|
||||||
# Run command for upload on Windows (Cygwin)
|
# Run command for upload on Windows (Cygwin)
|
||||||
if [ "${cygwin}" == "yes" ] ; then
|
if [ "${cygwin}" == "yes" ] ; then
|
||||||
if [ "${toolSelected}" == "rsync" ] ; then
|
if [ "${toolSelected}" == "rsync" ] ; then
|
||||||
comandOne="/usr/bin/sshpass -p ${1} /usr/bin/rsync -azL -e"
|
/usr/bin/rsync --progress -azL --rsh="/usr/bin/sshpass -p ${1} /usr/bin/ssh -l ${3}" ${2} ${4}:${5} 2> /dev/null
|
||||||
comandTwo="--progress ${2} ${3}@${4}:${5}"
|
|
||||||
${comandOne} "/usr/bin/ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" ${comandTwo} 2> /dev/null
|
|
||||||
/usr/bin/sshpass -p ${1} /usr/bin/ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
/usr/bin/sshpass -p ${1} /usr/bin/ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
||||||
OUTPUT=$?
|
OUTPUT=$?
|
||||||
else
|
else
|
||||||
|
@ -169,9 +167,7 @@ function sendFile() {
|
||||||
# Run command for upload on Unix systems
|
# Run command for upload on Unix systems
|
||||||
else
|
else
|
||||||
if [ "${toolSelected}" == "rsync" ] ; then
|
if [ "${toolSelected}" == "rsync" ] ; then
|
||||||
comandOne="sshpass -p ${1} rsync -azL -e"
|
rsync --progress -azL --rsh="sshpass -p ${1} ssh -l ${3}" ${2} ${4}:${5} 2> /dev/null
|
||||||
comandTwo="--progress ${2} ${3}@${4}:${5}"
|
|
||||||
${comandOne} "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" ${comandTwo} 2> /dev/null
|
|
||||||
sshpass -p ${1} ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
sshpass -p ${1} ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
||||||
OUTPUT=$?
|
OUTPUT=$?
|
||||||
else
|
else
|
||||||
|
@ -646,6 +642,12 @@ elif [ "${1}" == "-i" ] ; then
|
||||||
count=1
|
count=1
|
||||||
echo "+ ${totalFiles} common file(s) found!"
|
echo "+ ${totalFiles} common file(s) found!"
|
||||||
echo ""
|
echo ""
|
||||||
|
current_tool=$(cat ${dirConfig}/ks-upload-tool)
|
||||||
|
if [ "${current_tool}" == "scp" ] ; then
|
||||||
|
echo "* NOTE: You are using 'scp' to upload files and no progress will be shown."
|
||||||
|
echo "* IMPORTANT: It's possible switch to 'rsync' if you wish (Command: ks-upv -e)"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
while [ ${count} -le ${totalFiles} ] ; do
|
while [ ${count} -le ${totalFiles} ] ; do
|
||||||
fullNameFile=$(showFile ${count})
|
fullNameFile=$(showFile ${count})
|
||||||
fullPathFile=$(showPathFile ${count})
|
fullPathFile=$(showPathFile ${count})
|
||||||
|
|
14
src/ks-upr
14
src/ks-upr
|
@ -155,9 +155,7 @@ function sendFile() {
|
||||||
if [ "${toolSelected}" == "rsync" ] ; then
|
if [ "${toolSelected}" == "rsync" ] ; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "+ Syncing folder ${2} to ${5} (${4})"
|
echo "+ Syncing folder ${2} to ${5} (${4})"
|
||||||
comandOne="/usr/bin/sshpass -p ${1} /usr/bin/rsync -azL -e"
|
/usr/bin/rsync --progress -azL --rsh="/usr/bin/sshpass -p ${1} /usr/bin/ssh -l ${3}" ${2}/ ${4}:${5}/ 2> /dev/null
|
||||||
comandTwo="--progress ${2}/ ${3}@${4}:${5}/"
|
|
||||||
${comandOne} "/usr/bin/ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" ${comandTwo} 2> /dev/null
|
|
||||||
/usr/bin/sshpass -p ${1} /usr/bin/ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
/usr/bin/sshpass -p ${1} /usr/bin/ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -169,9 +167,7 @@ function sendFile() {
|
||||||
if [ "${toolSelected}" == "rsync" ] ; then
|
if [ "${toolSelected}" == "rsync" ] ; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "+ Syncing folder ${2} to ${5} (${4})"
|
echo "+ Syncing folder ${2} to ${5} (${4})"
|
||||||
comandOne="sshpass -p ${1} rsync -azlr -e"
|
rsync --progress -azL --rsh="sshpass -p ${1} ssh -l ${3}" ${2}/ ${4}:${5}/ 2> /dev/null
|
||||||
comandTwo="--progress ${2}/ ${3}@${4}:${5}/"
|
|
||||||
${comandOne} "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" ${comandTwo} 2> /dev/null
|
|
||||||
sshpass -p ${1} ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
sshpass -p ${1} ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -595,6 +591,12 @@ elif [ "${1}" == "-i" ] ; then
|
||||||
# Call the functions to perform the whole process.
|
# Call the functions to perform the whole process.
|
||||||
echo -n "* Scanning ${dirLocal} " && sleep 4
|
echo -n "* Scanning ${dirLocal} " && sleep 4
|
||||||
echo ""
|
echo ""
|
||||||
|
current_tool=$(cat ${dirConfig}/ks-upload-tool)
|
||||||
|
if [ "${current_tool}" == "scp" ] ; then
|
||||||
|
echo ""
|
||||||
|
echo "* NOTE: You are using 'scp' to upload files and no progress will be shown."
|
||||||
|
echo "* IMPORTANT: It's possible switch to 'rsync' if you wish (Command: ks-upv -e)"
|
||||||
|
fi
|
||||||
if [ -d ${dirLocal} ] ; then
|
if [ -d ${dirLocal} ] ; then
|
||||||
sendFile ${password} "${dirLocal}" ${user} ${server} ${dirServer}
|
sendFile ${password} "${dirLocal}" ${user} ${server} ${dirServer}
|
||||||
echo ""
|
echo ""
|
||||||
|
|
14
src/ks-upv
14
src/ks-upv
|
@ -139,9 +139,7 @@ function sendFile() {
|
||||||
# Run command for upload on Windows (Cygwin)
|
# Run command for upload on Windows (Cygwin)
|
||||||
if [ "${cygwin}" == "yes" ] ; then
|
if [ "${cygwin}" == "yes" ] ; then
|
||||||
if [ "${toolSelected}" == "rsync" ] ; then
|
if [ "${toolSelected}" == "rsync" ] ; then
|
||||||
comandOne="/usr/bin/sshpass -p ${1} /usr/bin/rsync -azL -e"
|
/usr/bin/rsync --progress -azL --rsh="/usr/bin/sshpass -p ${1} /usr/bin/ssh -l ${3}" ${2} ${4}:${5} 2> /dev/null
|
||||||
comandTwo="--progress ${2} ${3}@${4}:${5}"
|
|
||||||
${comandOne} "/usr/bin/ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" ${comandTwo} 2> /dev/null
|
|
||||||
/usr/bin/sshpass -p ${1} /usr/bin/ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
/usr/bin/sshpass -p ${1} /usr/bin/ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
||||||
OUTPUT=$?
|
OUTPUT=$?
|
||||||
else
|
else
|
||||||
|
@ -151,9 +149,7 @@ function sendFile() {
|
||||||
# Run command for upload on Unix systems
|
# Run command for upload on Unix systems
|
||||||
else
|
else
|
||||||
if [ "${toolSelected}" == "rsync" ] ; then
|
if [ "${toolSelected}" == "rsync" ] ; then
|
||||||
comandOne="sshpass -p ${1} rsync -azL -e"
|
rsync --progress -azL --rsh="sshpass -p ${1} ssh -l ${3}" ${2} ${4}:${5} 2> /dev/null
|
||||||
comandTwo="--progress ${2} ${3}@${4}:${5}"
|
|
||||||
${comandOne} "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" ${comandTwo} 2> /dev/null
|
|
||||||
sshpass -p ${1} ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
sshpass -p ${1} ssh ${3}@${4} rm -rf ${5}/.${6}.* &> /dev/null
|
||||||
OUTPUT=$?
|
OUTPUT=$?
|
||||||
else
|
else
|
||||||
|
@ -629,6 +625,12 @@ elif [ "${1}" == "-i" ] ; then
|
||||||
count=1
|
count=1
|
||||||
echo "+ ${totalFiles} video file(s) found!"
|
echo "+ ${totalFiles} video file(s) found!"
|
||||||
echo ""
|
echo ""
|
||||||
|
current_tool=$(cat ${dirConfig}/ks-upload-tool)
|
||||||
|
if [ "${current_tool}" == "scp" ] ; then
|
||||||
|
echo "* NOTE: You are using 'scp' to upload files and no progress will be shown."
|
||||||
|
echo "* IMPORTANT: It's possible switch to 'rsync' if you wish (Command: ks-upv -e)"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
while [ ${count} -le ${totalFiles} ] ; do
|
while [ ${count} -le ${totalFiles} ] ; do
|
||||||
fullNameFile=$(showFile ${count})
|
fullNameFile=$(showFile ${count})
|
||||||
fullPathFile=$(showPathFile ${count})
|
fullPathFile=$(showPathFile ${count})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user