commit
bd7a439998
@ -1,7 +1,26 @@ |
||||
#!/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 |
||||
curl $1|grep "<enclosure url"|cut -d'"' -f2|mpc add |
||||
$fetchcmd $1|grep "<enclosure url"|cut -d'"' -f2|mpc add |
||||
else |
||||
echo "Usage: $0 linktorss" >&2 |
||||
echo "Usage: $myname linktorss" >&2 |
||||
exit 1 |
||||
fi |
||||
|
Loading…
Reference in new issue