#!/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 <