Files
runner-images-sangeeth/images/linux/scripts/base/apt-mock.sh
Sergey Dolin ae7cb7f1a5 add shbang
2020-10-30 01:01:34 +05:00

25 lines
344 B
Bash

#!/bin/bash -e
prefix=/usr/local/bin
for tool in apt apt-get apt-fast;do
real_tool=`which $tool`
cat >$prefix/$tool <<EOT
#!/bin/sh
i=1
while [ \$i -le 10 ];do
$real_tool "\$@"
result=\$?
if [ \$result -eq 0 ];then
break
else
sleep 5
echo "...retry \$i"
i=\$((i + 1))
fi
done
EOT
chmod +x $prefix/$tool
done