bashrc & zshrc: add function to download sources.list for Ubuntu.

This commit is contained in:
Mikaela Suomalainen 2014-05-13 12:34:11 +03:00
parent e4da11776a
commit 21fd7af642
2 changed files with 68 additions and 0 deletions

34
bashrc
View File

@ -700,6 +700,40 @@ cd
}
# This function will download and install sources.list.
function ubuntu-sources-list-install {
export RELEASE=`lsb_release -sr`
a[1]="http://mkaysi.github.io/shell-things/sources.list/$RELEASE"
echo "I am now changing directory to /etc/apt/."
echo ""
cd /etc/apt/
echo "I will now backup sources.list to sources.list.bak ."
echo ""
cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo "I will now download the sources.list file from https://mkaysi.github.io/shell-things/sources.list/$RELEASE and save it as /etc/apt/sources.list ."
echo ""
echo "" > /etc/apt/sources.list
\wget ${a[1]} -O /etc/apt/sources.list
#\curl -L ${a[1]} >> /etc/apt/sources.list
echo ""
echo "The new sources.list file should now be installed."
echo ""
echo "Finally, I will now run 'apt-get -y update' so the new sources.list is used."
echo ""
apt-get update
echo "I have now finished everything that I was supposed to do."
}
# .custom
if [ -f ~/.custom ]; then

34
zshrc
View File

@ -672,6 +672,40 @@ cd
}
# This function will download and install sources.list.
function ubuntu-sources-list-install {
export RELEASE=`lsb_release -sr`
a[1]="http://mkaysi.github.io/shell-things/sources.list/$RELEASE"
echo "I am now changing directory to /etc/apt/."
echo ""
cd /etc/apt/
echo "I will now backup sources.list to sources.list.bak ."
echo ""
cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo "I will now download the sources.list file from https://mkaysi.github.io/shell-things/sources.list/$RELEASE and save it as /etc/apt/sources.list ."
echo ""
echo "" > /etc/apt/sources.list
\wget ${a[1]} -O /etc/apt/sources.list
#\curl -L ${a[1]} >> /etc/apt/sources.list
echo ""
echo "The new sources.list file should now be installed."
echo ""
echo "Finally, I will now run 'apt-get -y update' so the new sources.list is used."
echo ""
apt-get update
echo "I have now finished everything that I was supposed to do."
}
# Source files for miscannellious modifications.