Create url.sh

This commit is contained in:
tianyu 2014-12-24 20:20:30 +08:00
parent f1ec6a1502
commit b2231f0fc6
1 changed files with 12 additions and 0 deletions

12
url.sh Normal file
View File

@ -0,0 +1,12 @@
#!/bin/bash
# Convert nginx autoindex url to download link.
if [ -z "$1" ];then
echo "Error param."
exit 0
fi
URL=$1
for uri in $(curl -k -s $URL |grep '<a href' |grep -o "\".*\"");do
echo "$URL${uri//\"}"
done