|
|
@ -3,10 +3,13 @@ |
|
|
|
myname="$0" |
|
|
|
myname="$0" |
|
|
|
fetchcmd=curl |
|
|
|
fetchcmd=curl |
|
|
|
filter=cat |
|
|
|
filter=cat |
|
|
|
|
|
|
|
hostarg="" |
|
|
|
|
|
|
|
eval cast=\${$#} |
|
|
|
|
|
|
|
|
|
|
|
args=$(getopt fi $*) |
|
|
|
|
|
|
|
|
|
|
|
args=$(getopt fih $*) |
|
|
|
if [ $? -ne 0 ]; then |
|
|
|
if [ $? -ne 0 ]; then |
|
|
|
echo "Usage: $myname [-fi] linktorss" >& 2 |
|
|
|
echo "Usage: $myname [-fih] linktorss" >& 2 |
|
|
|
exit 1 |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
@ -24,14 +27,18 @@ while [ "$1" != -- ]; do |
|
|
|
exit 1 |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
fi |
|
|
|
;; |
|
|
|
;; |
|
|
|
|
|
|
|
-h) |
|
|
|
|
|
|
|
hostarg="--host=$3" |
|
|
|
|
|
|
|
;; |
|
|
|
esac |
|
|
|
esac |
|
|
|
shift |
|
|
|
shift |
|
|
|
done |
|
|
|
done |
|
|
|
shift |
|
|
|
shift |
|
|
|
|
|
|
|
|
|
|
|
if [ "$#" -eq 1 ]; then |
|
|
|
if [ $# -lt 3 ]; then |
|
|
|
$fetchcmd $1|grep "<enclosure url"|cut -d'"' -f2|$filter|mpc add |
|
|
|
$fetchcmd $cast|grep "<enclosure url"|sed "s/^.*url=//"|cut -d'"' -f2|$filter|mpc $hostarg add |
|
|
|
else |
|
|
|
else |
|
|
|
echo "Usage: $myname [-fi] linktorss" >&2 |
|
|
|
echo $0 $1 $2 $3 $4 $5 |
|
|
|
|
|
|
|
echo "Usage: $myname [-fih] linktorss" >&2 |
|
|
|
exit 1 |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
fi |
|
|
|