common.sh 649 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. pkgmanager=""
  3. if [[ -z "$1" ]]; then
  4. echo "!! box variable not set !!"
  5. exit 1
  6. fi
  7. if [[ "$1" == *"centos"* ]]; then
  8. pkgmanager="yum"
  9. yum install -y epel-release
  10. yum install -y python3 dnf policycoreutils-python python2-cryptography libselinux-python3
  11. yum install -y epel-release
  12. elif [[ "$1" == *"ubuntu"* ]]; then
  13. pkgmanager="apt-get"
  14. elif [[ "$1" == *"rocky"* ]]; then
  15. pkgmanager="dnf"
  16. dnf -y install epel-release
  17. dnf -y install python3 policycoreutils-python-utils python3-cryptography libselinux-python3
  18. else
  19. echo "box unsupported in provision bash common script !"
  20. exit 1
  21. fi
  22. #$pkgmanager install -y vim