3
#Enabled untrusted and no-prompt package installations
4
UntrustedUPEnabled='upgrade'
6
#Beginig the axeleration of package downloads
7
if echo "$@" | grep -q "$UntrustedUPEnabled"; then
8
cd /var/cache/apt/archives/
9
gksudo 'apt-get -qq --print-uris -y --force-yes --allow-unauthenticated' $@ | while read line ; do
10
Url="$(echo $line | awk '{print $1}' | tr -d \')"
12
Hash="$(echo $line | sed "s/.* .*:\(.*\)/\1/g")"
13
HashType="$(echo $line | sed "s/.* \(.*\):.*/\1/g")"
14
HashCalc="$(echo ${HashType,,}sum)"
15
File="$(basename $Url)"
16
FileHash="$($HashCalc $File | awk '{print $1}')"
17
if [[ "$FileHash" = "$Hash" ]]; then
18
echo -e "\E[32m33[1m$File successfully verified.33[0m"
20
echo -e "\E[31m\33[1m$File failed verification, retrying...33[0m"
23
FileSum="$($HashCalc $File | awk '{print $1}')"
24
if [[ "$FileHash" = "$Hash" ]]; then
25
echo -e "\E[32m33[1m$File successfully verified.33[0m"
27
echo -e "\E[31m33[1m$File failed verification, quiting.33[0m"
33
gksudo 'apt-get -y --force-yes --allow-unauthenticated' $@