home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / bin / liferea-add-feed < prev    next >
Encoding:
Extensible Markup Language  |  2010-07-19  |  646 b   |  30 lines

  1. #!/bin/sh
  2.  
  3.  
  4. # This script can be used to automatically add 
  5. # subscriptions to Liferea. Just supply a valid
  6. # and correctly escaped feed URL as parameter.
  7.  
  8. if [ $# -ne 1 ]; then
  9.     echo "Wrong parameter count!"
  10.     echo ""
  11.     echo "Syntax: $0 <feed URL>"
  12.     echo ""
  13.     exit 1
  14. fi
  15.  
  16. URL=$1
  17.  
  18. if ! which dbus-send >/dev/null 2>&1; then
  19.     echo "Unable to locate the 'dbus-send' tool."
  20.     echo "You need DBUS installed!"
  21.     exit 1
  22. fi
  23.  
  24. if ! pgrep -x liferea >/dev/null 2>&1; then
  25.     echo "Liferea is not running! You need to start it first."
  26.     exit 1
  27. fi
  28.  
  29. dbus-send --session --dest=org.gnome.feed.Reader /org/gnome/feed/Reader org.gnome.feed.Reader.Subscribe "string:$URL"
  30.