This commit is contained in:
xdtianyu
2015-01-27 14:00:21 +08:00
parent 1afd98180e
commit 6b347aa5b9
10 changed files with 0 additions and 0 deletions

63
net/cmurl.sh Normal file
View File

@@ -0,0 +1,63 @@
#!/bin/bash
URL=$1
TARGET=$2
DIRECTORY=$3
BYPY='/root/bypy/bypy.py'
URL=$(curl -k -s $URL |grep $TARGET |grep -v html| sed -n "s|.*href=\"\([^\"]*\).*|$URL\1|p")
if [ -z "$URL" ];then
echo "ERROR"
exit 0
fi
echo $URL
ZIP="${URL##*/}"
echo $ZIP
if [ -f "$DIRECTORY/$ZIP" ];then
echo "DOWNLOADED"
exit 0
fi
if [ ! -d "$DIRECTORY" ];then
echo "ERROR DIR"
exit 0
fi
if [ -f "$DIRECTORY/$ZIP.done" ];then
echo "UPLOADED"
exit 0
fi
cd $DIRECTORY
touch none.done
for file in *.done;do
echo "REMOVE $file"
rm $file
done
wget $URL > $ZIP.wget.log 2>&1
md5sum $ZIP > $ZIP.md5
$BYPY -v -s 10MB syncup . cyanogenmod
if [ -f "$DIRECTORY/$ZIP" ];then
rm "$DIRECTORY/$ZIP"
fi
if [ -f "$DIRECTORY/$ZIP.md5" ];then
rm "$DIRECTORY/$ZIP.md5"
fi
if [ -f "$DIRECTORY/$ZIP.wget.log" ];then
rm "$DIRECTORY/$ZIP.wget.log"
fi
touch "$DIRECTORY/$ZIP.done"
cd -

25
net/lurl.sh Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
# Convert lighttpd autoindex url to download link.
if [ -z "$1" ];then
echo "Error param."
exit 0
fi
URL=$1
if [ -z "$2" ];then
curl -k -s $URL | sed -n "s|.*href=\"\([^\"]*\).*|$URL\1|p"
else
if [ "$2"=="--auth" ];then
if [ -z "$3" ];then
echo "Error user."
exit 0
fi
if [ -z "$4" ];then
echo "Error password."
exit 0
fi
curl -k -s -u $3:$4 $URL | sed -n "s|.*href=\"\([^\"]*\).*|$URL\1|p"
exit 0
fi
fi

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

12
net/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