aboutsummaryrefslogtreecommitdiff
path: root/bin/scps
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2020-01-17 12:16:49 +0100
committerJakob Stendahl <jakob.stendahl@outlook.com>2020-01-17 12:16:49 +0100
commit4ef14d855be8f6a56e05483a34f572d5b8c2f151 (patch)
treed3b89dde7a5e6ed26011a0496f4e3ecf5040e404 /bin/scps
parentf1524969f404fff4e79ae631db2db3865dc5be15 (diff)
downloaddotfiles-4ef14d855be8f6a56e05483a34f572d5b8c2f151.tar.gz
dotfiles-4ef14d855be8f6a56e05483a34f572d5b8c2f151.zip
Updated vimconf, and made som bash scripts
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"