aboutsummaryrefslogtreecommitdiff
path: root/bin/scps
diff options
context:
space:
mode:
Diffstat (limited to 'bin/scps')
-rwxr-xr-xbin/scps28
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/scps b/bin/scps
new file mode 100755
index 0000000..f8f9b30
--- /dev/null
+++ b/bin/scps
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+if [ -z $1 ]; then
+ tput setaf 1
+ echo "Server not provided."
+ tput sgr0
+ exit 1
+fi
+
+if [ -z $2 ]; then
+ tput setaf 1
+ echo "File not provided."
+ tput sgr0
+ exit 1
+fi
+
+if [[ -d $2 ]]; then
+ tput setaf 1
+ echo "Cannot move directories..."
+ tput sgr0
+ exit 1
+fi
+
+SERVER="$1"
+FILE="$2"
+SERVERFILE="$(basename $FILE)"
+
+scp "$FILE" "$SERVER":"$SERVERFILE"