19 lines
303 B
Plaintext
19 lines
303 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
SECRET="$(pass paf)"
|
||
|
AUTH="-HAuthorization: Secret $SECRET"
|
||
|
INSTANCE="https://p.afpy.org/"
|
||
|
|
||
|
if [[ $1 == "--list" ]]
|
||
|
then
|
||
|
curl "$AUTH" $INSTANCE::/list/
|
||
|
exit
|
||
|
fi
|
||
|
|
||
|
if [[ $# == 0 ]]
|
||
|
then
|
||
|
curl "$AUTH" "$INSTANCE" --data-binary @-
|
||
|
else
|
||
|
curl "$AUTH" "$INSTANCE" "${@/*/-F&=@&}"
|
||
|
fi
|