diff --git a/transfersh-server/static/index.html b/transfersh-server/static/index.html
index 9e9d5f4..0f49e4d 100644
--- a/transfersh-server/static/index.html
+++ b/transfersh-server/static/index.html
@@ -70,7 +70,7 @@
$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt https://transfer.sh/66nb8/hello.txt
- # Create an alias
+ # Using the alias
$ transfer hello.txt
##################################################### 100.0% https://transfer.sh/eibhM/hello.txt
@@ -165,19 +165,33 @@
# Add this to .bashrc or its equivalent
transfer() {
-
# write to output to tmpfile because of progress bar
-
tmpfile=$( mktemp -t transferXXX ); basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
-
curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile
-
cat $tmpfile; rm -f $tmpfile;
+
if [ $# -eq 0 ]; then
+
echo "No arguments specified. Usage:"
+
echo "$ transfer /tmp/test.md"
+
echo "$ cat /tmp/test.md | transfer test.md"
+
return 1
+
fi
+
+
# write to output to tmpfile because of progress bar
+
tmpfile=$( mktemp -t transferXXX );
+
+
if tty -s; then
+
basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g');
+
curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile;
+
else
+
curl --progress-bar --upload-file "-" "https://transfer.sh/$1"
+
fi
+
+
cat $tmpfile; rm -f $tmpfile;
}
-
+
alias transfer=transfer
@@ -268,6 +282,23 @@
+ # Import keys from keybase
+
$ keybase track [them]
+ # Encrypt for recipient(s)
+
$ cat somebackupfile.tar.gz | keybase encrypt [them] | curl --upload-file '-' https://transfer.sh/test.txt
+ # Decrypt
+
$ curl https://transfer.sh/sqUFi/test.md |keybase decrypt
+
+
# Add this to .bashrc or its equivalent
transfer() {
-
# write to output to tmpfile because of progress bar
-
tmpfile=$( mktemp -t transferXXX ); basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
-
curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile
-
cat $tmpfile; rm -f $tmpfile;
+
if [ $# -eq 0 ]; then
+
echo "No arguments specified. Usage:"
+
echo "$ transfer /tmp/test.md"
+
echo "$ cat /tmp/test.md | transfer test.md"
+
return 1
+
fi
+
+
# write to output to tmpfile because of progress bar
+
tmpfile=$( mktemp -t transferXXX );
+
+
if tty -s; then
+
basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g');
+
curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile;
+
else
+
curl --progress-bar --upload-file "-" "https://transfer.sh/$1"
+
fi
+
+
cat $tmpfile; rm -f $tmpfile;
}
-
+
alias transfer=transfer
@@ -242,6 +256,23 @@ include "includes/head.html"
+ # Import keys from keybase
+
$ keybase track [them]
+ # Encrypt for recipient(s)
+
$ cat somebackupfile.tar.gz | keybase encrypt [them] | curl --upload-file '-' https://transfer.sh/test.txt
+ # Decrypt
+
$ curl https://transfer.sh/sqUFi/test.md |keybase decrypt
+
+