Advertisement
metalx1000

wget msgboard script

Feb 18th, 2018
919
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.47 KB | None | 0 0
  1. #!/bin/bash
  2. url="<url>"
  3. key="<key>"
  4. user="<user name>"
  5.  
  6. if [ "$1" = "help" ]
  7. then
  8.   echo "To read message board:"
  9.   echo "$0"
  10.   echo ""
  11.   echo "To post a message:"
  12.   echo "$0 'Hello World'"
  13.   exit 1
  14. fi
  15.  
  16. if [ $# -lt 1 ];
  17. then
  18.   curl -s "${url}?key=${key}&user=${user}"|grep -v -e '^<' -e '^ '
  19. else
  20.   msg="$(echo $*|sed 's/ /%20/g')"
  21.   curl -s "${url}?key=${key}&user=${user}&msg=${msg}"
  22.   curl -s "${url}?key=${key}&user=${user}"|grep -v -e '^<' -e '^ '
  23. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement