Yes, you're right! I was sleepy last night! :D
First of all, specially thanks for your nice work.
I used your apt-fast script and found that some modifications [maybe] make it better:
1- 'root' checking was added at the first of the script.
2- In the main IF-ELSE structure, 'upgrade', 'install' and 'dist-upgrade' options are filtered and the other options are passed to 'apt-get' itself. Obviously, wrong options are detected by 'apt-get' itself.
Annotation: I think for example 'grep [install]' filters the text which have the letters 'i', 'n', 's' and etc separately. For example '
induc
t' is accepted with [install] filter which is not acceptable for our goal. I tested it and it works as I say. Am I mistaken?
3- Some text formatting was added. I made the outputs of 'apt-fast' bold to be distinguishable from 'apt-get' and 'axel' outputs and I also added '[apt-fast]' label at the first of its output.
4- In new script downloading process are done in '/var/cache/apt/archive/partial/' rather than '/var/cache/apt/archive'. When download finish successfully, downloaded packages are moved to '/var/cache/apt/archive'. It's exactly what 'apt-get' does.
5- When we install a package with 'apt-get'. It prints some information about packages which are going to download and install and ask us "Do you want to continue [Y/n]?". I added this functionality to the script too. First, I print the information which had been inserted to debs.list file without showing urls with this command:
Code:
head -n $(( `cat debs.list|wc -l` - `egrep -o -e "(ht|f)tp://[^\']+" debs.list|wc -l` )) debs.list
and then ask the user "Do you want to continue [Y/n]?". If the answer is yes, it starts to download the packages.
That's it. :)
In addition, I forgot to remove the line 'Modified by ...'. Sorry, I added this comment to specify that it's different from previous 'apt-fast' which I had downloaded.
Sincerely,
Ali