23 lines
462 B
Bash
Executable File
23 lines
462 B
Bash
Executable File
#!/bin/bash
|
|
# Xeha <Xeha@i2pmail.org>
|
|
|
|
usage() {
|
|
echo "0xff [<file>] - A script to post stdin or a file to 0xff.i2p"
|
|
echo "If no file is specified (maximum of one), STDIN will be used."
|
|
echo
|
|
}
|
|
|
|
if [ "$#" -gt "1" ]; then
|
|
usage
|
|
echo "ERROR: too many args" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$#" -eq "1" ]; then
|
|
# file upload mode
|
|
curl --proxy 127.0.0.1:4444 -T "$1" http://0xff.i2p | cat
|
|
else
|
|
# STDIN mode
|
|
curl --proxy 127.0.0.1:4444 -T - http://0xff.i2p <&0 | cat
|
|
fi
|