Skip to content

Instantly share code, notes, and snippets.

@simonexmachina
Forked from alexhayes/building-install
Created June 4, 2012 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save simonexmachina/2867667 to your computer and use it in GitHub Desktop.
Save simonexmachina/2867667 to your computer and use it in GitHub Desktop.
Install rsync and php4-domxml on old Debian
#!/bin/bash
V30=`grep "3.0" /etc/issue`
V31=`grep "3.1" /etc/issue`
V4=`grep "4." /etc/issue`
V5=`grep "5." /etc/issue`
V6=`grep "6." /etc/issue`
UPDATE_SOURCES=1
if [ "$V30" != "" ]; then
VERSION='woody'
elif [ "$V31" != "" ]; then
VERSION='sarge'
elif [ "$V4" != "" ]; then
VERSION='etch'
elif [ "$V5" != "" ]; then
VERSION='lenny'
elif [ "$V6" != "" ]; then
VERSION='squeeze'
# Lets leave the sources alone for this distro, they should be up-to-date
UPDATE_SOURCES=0
else
echo "Can't determine Debian version from /etc/issue"
cat /etc/issue
exit 1
fi
if [ $UPDATE_SOURCES -eq 1 ]; then
# Note that double hash so that we can always tell which hashes we added if we ever need to go back and compare
sed -e "s/^deb/##deb/" /etc/apt/sources.list --in-place && echo "deb http://ftp.iinet.net.au/debian/debian-archive/debian/ $VERSION main contrib non-free" >> /etc/apt/sources.list && apt-get update
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment