Пруф. старый код скрипта(если новый не работает, то юзайте старую версию):
#!/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,/$chan_section/css,/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=
А вот обновленный, который я запостид:
#!/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=