You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
369 B
26 lines
369 B
#!/bin/sh
|
|
|
|
myname="$0"
|
|
fetchcmd=curl
|
|
|
|
args=$(getopt f $*)
|
|
if [ $? -ne 0 ]; then
|
|
echo "Usage: $myname [-f] linktorss" >& 2
|
|
exit 1
|
|
fi
|
|
|
|
set -- $args
|
|
while [ "$1" != -- ]; do
|
|
case "$1" in
|
|
-f) fetchcmd=cat ;;
|
|
esac
|
|
shift
|
|
done
|
|
shift
|
|
|
|
if [ "$#" -eq 1 ]; then
|
|
$fetchcmd $1|grep "<enclosure url"|cut -d'"' -f2|mpc add
|
|
else
|
|
echo "Usage: $myname linktorss" >&2
|
|
exit 1
|
|
fi
|
|
|