Created
June 4, 2012 07:44
-
-
Save alexhayes/2867024 to your computer and use it in GitHub Desktop.
Install rsync and php4-domxml on old Debian
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 && apt-get install rsync php4-domxml -y | |
else | |
apt-get update && apt-get install rsync php4-domxml -y | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment