Advertisement
mouhsineelachbi

install apt-fast

Dec 7th, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.71 KB | None | 0 0
  1. #!/bin/bash
  2. set -e
  3.  
  4. apt_fast_installation() {
  5.   if ! dpkg-query --show aria2 >/dev/null 2>&1; then
  6.     sudo apt-get update
  7.     sudo apt-get install -y aria2
  8.   fi
  9.  
  10.   wget https://raw.githubusercontent.com/ilikenwf/apt-fast/master/apt-fast -O /usr/local/sbin/apt-fast
  11.   chmod +x /usr/local/sbin/apt-fast
  12.   if ! [[ -f /etc/apt-fast.conf ]]; then
  13.     wget https://raw.githubusercontent.com/ilikenwf/apt-fast/master/apt-fast.conf -O /etc/apt-fast.conf
  14.   fi
  15. }
  16.  
  17.  
  18. if [[ "$EUID" -eq 0 ]]; then
  19.   apt_fast_installation
  20. else
  21.   type sudo >/dev/null 2>&1 || { echo "sudo not installed, change into root context" >&2; exit 1; }
  22.  
  23.   DECL="$(declare -f apt_fast_installation)"
  24.   sudo bash -c "$DECL; apt_fast_installation"
  25. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement