feat: added secure random URL option
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
b66c0f0e00
commit
22a7b5b3fc
4 changed files with 101 additions and 52 deletions
29
landerctl
29
landerctl
|
|
@ -3,16 +3,35 @@
|
|||
API_KEY=test
|
||||
URL=http://localhost:18080
|
||||
|
||||
if [ "$1" = add ]; then
|
||||
if [ "$1" = g ]; then
|
||||
curl -is "$URL/$2" |
|
||||
sed -En 's/^[lL]ocation: (.*)/\1/p'
|
||||
|
||||
elif [ "$1" = s ]; then
|
||||
curl \
|
||||
-XPOST \
|
||||
-d "$2" \
|
||||
-H "X-Api-Key: $API_KEY" \
|
||||
"$URL/s/$3"
|
||||
|
||||
elif [ "$1" = get ]; then
|
||||
curl -is "$URL/$2" | sed -En 's/^[lL]ocation: (.*)/\1/p'
|
||||
elif [ "$1" = sl ]; then
|
||||
curl \
|
||||
-XPOST \
|
||||
-d "$2" \
|
||||
-H "X-Api-Key: $API_KEY" \
|
||||
"$URL/sl/$3"
|
||||
|
||||
elif [ "$1" = paste ]; then
|
||||
curl --data-binary @"$2" -XPOST -H "X-Api-Key: $API_KEY" "$URL/p/$3"
|
||||
elif [ "$1" = p ]; then
|
||||
curl \
|
||||
-XPOST \
|
||||
-H "X-Api-Key: $API_KEY" \
|
||||
--data-binary @"$2" \
|
||||
"$URL/p/$3"
|
||||
|
||||
elif [ "$1" = pl ]; then
|
||||
curl \
|
||||
-XPOST \
|
||||
-H "X-Api-Key: $API_KEY" \
|
||||
--data-binary @"$2" \
|
||||
"$URL/pl/$3"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue