Useful CLI tools (bash) for Arch Linux administration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
529 B

6 years ago
  1. #!/bin/bash
  2. ##############################################
  3. # Install locally build program on Arch Linux
  4. if [ -e ./PKGBUILD ]; then #We check whether PKGBUILD file exists. If yes, then...
  5. PACKAGE_NAME=$(cat ./PKGBUILD | grep "pkgname=" | sed -e 's/pkgname=//g') #get package name from PKGBUILD
  6. PACKAGE=$(echo $PACKAGE_NAME*.pkg.tar.xz) #package name + * + suffix
  7. if [ -e $PACKAGE ]; then # If package has been compiled, then...
  8. sudo pacman -U $PACKAGE # ...install the package.
  9. fi
  10. else
  11. return 1
  12. fi