# bbs/upload - upload a file to dropbox
# usage: upload filename < content
# example: cat myfile.txt | upload myfile.txt

bbs=/n/bbs

if (test ! -d $bbs) {
    echo 'BBS not connected. Run: bbs/connect'
    exit 1
}

if (test $#* -eq 0) {
    echo 'usage: upload filename < content'
    exit 1
}

cat > $bbs/dropbox/$1
echo 'Uploaded:' $1
