From 5cdf4e88e887255f59aea60b5c68725ebebb293f Mon Sep 17 00:00:00 2001 From: age Date: Sun, 12 Jun 2005 17:40:26 +0000 Subject: [PATCH] =?UTF-8?q?dies=20ist=20ein=20kleines=20script=20f=C3=BCr?= =?UTF-8?q?=20entfernte=20debian=20upgrades,=20wenn=20vor=20ort=20kaum=20n?= =?UTF-8?q?etz=20aber=20ein=20wechseldatentr=C3=A4ger=20zur=20verf=C3=BCgu?= =?UTF-8?q?ng=20steht.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- netz-tools/apt-get-interim-update | 109 ++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100755 netz-tools/apt-get-interim-update diff --git a/netz-tools/apt-get-interim-update b/netz-tools/apt-get-interim-update new file mode 100755 index 0000000..de0f0a8 --- /dev/null +++ b/netz-tools/apt-get-interim-update @@ -0,0 +1,109 @@ +#!/bin/bash -e +COMMENT="# this script is part of apt-get-interim, a tool for updating a debian system +# without fast local net connection. +# there are three stages. +# first read in a list of needed packages. +# second download them on any debian system with fast internet connection. +# third install them on the origin debian system +# a bunch of scripts will be generated by apt-get-interim, +# so you simply have to start four scripts at all and everything will be fine :) +## send comments to age-at-systemausfall-dot-org" + +USAGEHINT="apt-get-interim-update - APT for lousy connected boxes\n +usage: $0 DIR [ACTION]\n +\tDIR should be the path to your removeable media\n +\tACTION can be \"upgrade\", \"dist-upgrade\", \"install PACKAGELIST\"\n +\t\tdefault action is dist-upgrade" + +VERSION="0.2" + +# what apt-get action should be performed (e.g. upgrade, install package foo, ..) +ACTION="dist-upgrade" +#ACTION="install $2" ##where $2 is a file with packagenames or a package or ia list of packages in quotes + +# which sources list should be used +SRCLIST="/etc/apt/sources.list" + +[ -z "$1" ] && echo -e $USAGEHINT && exit 1 +MEDIUM="$1" +echo "your media: $MEDIUM" +[ ! -d $MEDIUM -o ! -w $MEDIUM -o ! -x $MEDIUM ] && echo -e "\tis not writeable!" && exit 1 +[ ! -z "$2" ] && ACTION="$2" +echo "apt-get action: $ACTION" +SCRIPT1=${MEDIUM}/apt-get-interim_1_$(uname -n) +SCRIPT2=${MEDIUM}/apt-get-interim_2_$(uname -n) +SCRIPT3=${MEDIUM}/apt-get-interim_3_$(uname -n) +REMOTE_APT_CONF=${MEDIUM}/apt.conf + +## generate stage 1 script for local update +cat > $SCRIPT1 < $REMOTE_APT_CONF < $SCRIPT2 < $SCRIPT3 <