Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ -f $HOME/.wallabash ]; then
- . $HOME/.wallabash
- fi
- API="$WALLABAG_URL/api/entries.html"
- AUTH=$(curl -s "$WALLABAG_URL/oauth/v2/token" -d "grant_type=password" \
- -d "client_secret=$WALLABAG_CLIENT_SECRET" \
- -d "client_id=$WALLABAG_CLIENT_ID" \
- -d "username=$WALLABAG_USERNAME" \
- -d "password=$WALLABAG_PASSWORD")
- TOKEN=$(echo $AUTH | jq -r '.access_token')
- if [ -z "$1" ]; then
- curl -s -G "$API" -d "access_token=$TOKEN" | jq -r '._embedded.items[].url'
- else
- curl -s "$API" -d "access_token=$TOKEN" -d "url=$1" > /dev/null
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement