sonulen / scripts

Репозиторий с полезными скриптами
0 stars 0 forks source link

Install with check #1

Open sonulen opened 5 years ago

sonulen commented 5 years ago

Установка чего либо если оно отсутствует:

install_with_check() {
  PKG_NAME=$(dpkg -l | cut -d " " -f 3 | grep "^$1$")
  if [ -z "$PKG_NAME" ]
  then
    eval "apt install $1"
  fi
}

Юзкейс:

install_with_check "flightgear"