Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # update friendika from bash with curl
- # I put this in my path as "friendicurl"
- # usage would be "friendicurl some text for update"
- # here you enter your username and password
- # you could simply assign these variables
- # even in the curl command below, and skip this step.
- # If I weren't lazy, I would also make it so you could have a .friendicurl config file
- # to contain this data, I suppose...
- read -p "username: " uname
- read -p "password: " pwrd
- # if you did not enter text for update, the script asks for it
- if [[ $(echo $*) ]]; then
- ud="$*"
- else
- read -p "Enter your update text: " ud
- fi
- # and this is the curl command that sends the update to the server
- if [[ $(curl -u $uname:$pwrd -d status="$ud" http://friendika.openmindspace.org/api/statuses/update.xml | grep error) ]]; then
- # what does the server say?
- echo "Error"
- else
- echo "Success!"
- echo $ud
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement