bin sh if -lt -z expr http res 0-9 0-9 ml then echo Usage sohranyach s

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#! /bin/sh
if [ $# -lt 1 ] || [ -z `expr $1 : "\(http://[^/][^/]*/[^/][^/]*/res/[0-9][0-9]*.*ml\)"` ]
then echo "Usage: sohranyach.sh [URL]"; exit; fi
chan_section=`expr $1 : "http://[^/]*/\(.*\)/res/"`
chan_section_url=$(expr $1 : "\(.*\)/res/" | sed "s|\/|\\\/|g")
fnm=`expr $1 : ".*/\([^/]*\)"`
if [ -f $fnm ] && [ `du $fnm | cut -f1` -ge 10 ]; then rm -f $fnm.bak; mv $fnm $fnm.bak; fi
wget -r -l1 -nd -N -k -p -e robots=off -I/src,/$chan_section/src,/thumb,/$chan_section/thumb,/js,/lib/javascript,/css $1
sed -i "s/$chan_section_url\/src\///g" $fnm; sed -i "s/$chan_section_url\/thumb\///g" $fnm
chan_section=
chan_section_url=
fnm=