aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xkvmx32
1 files changed, 28 insertions, 4 deletions
diff --git a/kvmx b/kvmx
index 5bbaa76..d52cc8a 100755
--- a/kvmx
+++ b/kvmx
@@ -618,6 +618,14 @@ function kvmx_rsync_to {
ORIG="$3"
DEST="$4"
+ if [ -z "$DEST" ]; then
+ # Error
+ #exit 1
+
+ # Assume same as origin
+ DEST="$ORIG"
+ fi
+
# Fix ~/ path
if echo $DEST | grep -q -e "^$HOME"; then
DEST="$(echo $DEST | sed -e "s|^$HOME|/home/$SSH_LOGIN|")"
@@ -637,6 +645,14 @@ function kvmx_rsync_from {
ORIG="$3"
DEST="$4"
+ if [ -z "$DEST" ]; then
+ # Error
+ #exit 1
+
+ # Assume same as origin
+ DEST="$ORIG"
+ fi
+
# Fix ~/ path
if echo $ORIG | grep -q -e "^$HOME"; then
ORIG="$(echo $ORIG | sed -e "s|^$HOME|/home/$SSH_LOGIN|")"
@@ -655,10 +671,13 @@ function kvmx_scp_from {
ORIG="$3"
DEST="$4"
- SSH="`cat $SSHFILE`"
if [ -z "$DEST" ]; then
- exit 1
+ # Error
+ #exit 1
+
+ # Assume same as origin
+ DEST="$ORIG"
fi
# Fix ~/ path
@@ -666,6 +685,7 @@ function kvmx_scp_from {
ORIG="$(echo $ORIG | sed -e "s|^$HOME|/home/$SSH_LOGIN|")"
fi
+ SSH="`cat $SSHFILE`"
$SCP_COMMAND -o Port=$SSH 127.0.0.1:$ORIG $DEST
}
@@ -678,10 +698,13 @@ function kvmx_scp_to {
ORIG="$3"
DEST="$4"
- SSH="`cat $SSHFILE`"
if [ -z "$DEST" ]; then
- exit 1
+ # Error
+ #exit 1
+
+ # Assume same as origin
+ DEST="$ORIG"
fi
# Fix ~/ path
@@ -689,6 +712,7 @@ function kvmx_scp_to {
DEST="$(echo $DEST | sed -e "s|^$HOME|/home/$SSH_LOGIN|")"
fi
+ SSH="`cat $SSHFILE`"
$SCP_COMMAND -o Port=$SSH $ORIG 127.0.0.1:$DEST
}