From c7e31dabc5cdf0fef43a0fe185042fb2ed66bc10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Sko=C5=99epa?= <jakub@skorepa.info>
Date: Thu, 7 Apr 2016 16:06:10 +0200
Subject: [PATCH] Allow to select ftp vs sftp

---
 upload | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/upload b/upload
index 2e15a9df..b7917793 100755
--- a/upload
+++ b/upload
@@ -11,5 +11,15 @@ node index.js --noserver
 echo "Site compiled"
 chmod a+X build -R
 
+USER=ok1kvk.cz-www-nove
+HOST=ok1kvk.cz
+
+echo "======================================================================"
 echo "Uploading to nove.ok1kvk.cz"
-lftp -c "set ftp:ssl-allow no; open --user ok1kvk.cz-www-nove --env-password ftp://ok1kvk.cz/; mirror -c --verbose=9 -e -R -L ./build /"
+if [ $1 == "ftp" ]; then
+    echo "Using FTP"
+    lftp -c "set ftp:ssl-allow no;open --user ok1kvk.cz-www-nove --env-password ftp://ftp.ok1kvk.cz/; mirror -c --verbose=9 -e -R -L ./build /"
+else
+    echo "Using SFTP"
+    lftp -c "set ftp:ssl-allow no;open --user ok1kvk.cz-www-nove --env-password -p 2121 sftp://ftp.ok1kvk.cz/; mirror -c --verbose=9 -e -R -L ./build /"
+fi
-- 
GitLab