--------------------------------Linux Guide---------------------------------- by Ingo Blechschmidt (c) 2002 ----------------------------------------------------------------------------- ------------------------- Internet on a floppy ------------------------- Die Jul 31 13:08:51 MEST 2000 ------------------------- Internet floppy überformatiert Diskette wget quota while du ----------------------------------------------------------------------------- Sie haben zwei Computer, einen mit und einen ohne Internet-Anschluss, und wollen einige Webseiten auf Diskette kopieren. get_inet.sh hilft dabei. ----------------------------------------------------------------------------- Das Skript, siehe <"down/get_inet.sh">Download: --------CODE--------: get_inet.sh #!/bin/bash$ $ # get_inet.sh - Holt Webseiten aus dem Internet und speichert sie auf Diskette.$ # Copyright (C) Mon Jul 30 20:53:44 MEST 2001 by Ingo Blechschmidt$ #$ # This program is free software; you can redistribute it and/or modify$ # it under the terms of the GNU General Public License as published by$ # the Free Software Foundation; either version 2 of the License, or$ # (at your option) any later version.$ #$ # This program is distributed in the hope that it will be useful,$ # but WITHOUT ANY WARRANTY; without even the implied warranty of$ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the$ # GNU General Public License for more details.$ #$ # You should have received a copy of the GNU General Public License$ # along with this program; if not, write to the Free Software$ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.$ #$ # Ingo Blechschmidt$ # Arberstraße 5$ # 86179 Augsburg$ # E-Mail: iblech@web.de, http://www.way.to/uselinux/$ # Tel.: +49 / 821 882955$ #$ # $ $ echo get_inet.sh - Holt Webseiten aus dem Internet und speichert sie auf Diskette.$ echo Copyright '(C)' Mon Jul 30 20:53:44 MEST 2001 by Ingo Blechschmidt$ echo$ echo This program is free software\; you can redistribute it and/or modify$ echo it under the terms of the GNU General Public License as published by$ echo the Free Software Foundation\; either version 2 of the License, or$ echo '(at your option)' any later version.$ echo$ echo This program is distributed in the hope that it will be useful,$ echo but WITHOUT ANY WARRANTY\; without even the implied warranty of$ echo MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the$ echo GNU General Public License for more details.$ echo$ echo You should have received a copy of the GNU General Public License$ echo along with this program\; if not, write to the Free Software$ echo Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.$ echo$ echo Ingo Blechschmidt$ echo Arberstraße 5$ echo 86179 Augsburg$ echo E-Mail: iblech@web.de, http://www.way.to/uselinux/$ echo$ echo $ $ $ WEBSITES="http://gnome.org/todo http://sources.redhat.com/gsl$ http://www.linux-magazin.de/ausgabe/1998/08/Pouder/pouder.html$ http://www.gnu.org/manual/make/html_chapter/make_toc.html$ http://www.gnu.org/manual/sharutils-4.2/html_chapter/sharutils_toc.html"$ # List of websites to get,$ # whitespace separated.$ # my datas:$ # COMP_RATE="11" # Compression rate of tar.bz2.$ # MAX_SIZE="1722" # Maximum space of a$ # # "over-formatted" floppy.$ SIZE_PER_SITE="150" # Size per site, in kb.$ $ [ -e /tmp/get_inet ] || mkdir /tmp/get_inet/ # Crating temporary directory.$ cd /tmp/get_inet/$ $ # start of the request loop,$ # get files until a$ # over-formatted floppy is$ # full.$ while$ [ "$[`du -skc /tmp/get_inet/ | tail -n 1 | gawk '{ print $1; }'`<1500]" = "1" ]$ do$ for i in $WEBSITES; do # for-loop.$ echo ">> $0: Getting $i..."$ # Getting the files, except$ # image-, video- and$ # sound-files.$ HOST=`echo $i | gawk -F / '{ print $3; }'` # Host-limitation.$ wget -nv -k -nc -D $HOST -c -r -Q ${SIZE_PER_SITE}k -R "jpeg,jpg,gif,png,avi,mpg,wav,mp3" $i$ done$ done$ $ mount /mnt2 # Mounting the floppy,$ # /dev/fd0u1722.$ # Saving and compressing the$ # web.$ # mount -t ext2 /dev/fd0u1722 /mnt2$ $ echo "Packe..."$ $ tar cvvvIf /mnt2/maze/get_inet.tar.bz2 /tmp/get_inet/ && rm -r /tmp/get_inet/$ umount /mnt2 & # U-mounting the floppy, as a$ # background job (the &),$ # therewith the next line is$ # being started immediate.$ # rm -r /tmp/get_inet$ --------/CODE--------