blob: e6868f61162cc2410a4e8f5f57477189f4026dad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/bin/sh
mode=$1
url=$2
file=$3
LIBDIR="@LIBDIR@"
source "$LIBDIR/functions"
USERAGENT="fb-client/shell-@VERSION@"
CURLOPTS="-n -L -A $USERAGENT"
if [ "$mode" = "u" ]; then
basefilename=`basename -- "$file"`
if [ `$STAT -- "$file"` -eq "0" ] || echo "$basefilename" | grep -F -q ","; then
basefilename=`echo "$basefilename" | tr -d ,`
curl $CURLOPTS -F "file=@-;filename=$basefilename" "$url" < "$file" -o /dev/stdout
else
curl $CURLOPTS -F "file=@$file" "$url" -o /dev/stdout
fi
else
curl $CURLOPTS "$url"
fi
|