Last active
March 27, 2019 09:29
-
-
Save mansurali901/119de1f022d362f885fefb30a590303f to your computer and use it in GitHub Desktop.
This script is used to install older version of docker using deb package
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 | |
# This script is used to install older version of docker | |
# using deb package | |
# Author Mansur Ul Hasan | |
# EMail [email protected] | |
InstallDep () { | |
echo "deb http://security.ubuntu.com/ubuntu trusty-security main" >> /etc/apt/sources.list | |
apt-get update | |
apt-get install build-essential -y | |
apt-get install libsystemd-journal0 -y | |
} | |
PackageInstall () { | |
echo "Downloading Docker version 1.12 for Ubuntu Trusty" | |
wget https://apt.dockerproject.org/repo/pool/main/d/docker-engine/$version.deb | |
dpkg -i $version.deb | |
sleep 20 | |
dockerd & | |
} | |
DependenciesCheck () { | |
depCheck=`dpkg -l libsystemd-journal0 > /tmp/depcheck` | |
if [ -s "$_file" ] | |
then | |
PackageInstall | |
else | |
InstallDep | |
PackageInstall | |
fi | |
} | |
CheckAvailableVersion () { | |
curl https://apt.dockerproject.org/repo/pool/main/d/docker-engine/?fbclid=IwAR1Z3LdGAgnyKVET6KeRbQxZwMyU94h-mCqTa3b5OdD65Fb_OYZtNt44MjM |cut -d'"' -f2 |grep -v ":\|<" > versions.list | |
cat versions.list | |
echo "While entering version do not include .deb " | |
echo " " | |
echo " " | |
sleep 10 | |
read -p "Enter version need to install " version | |
# Installation Function | |
DependenciesCheck | |
} | |
CheckAvailableVersion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment