debinstall.sh 459 B

123456789101112131415161718
  1. #!/bin/sh
  2. #
  3. # Install Debian packages needed to run Odoo.
  4. if [ "$(id -u)" -ne "0" ]; then
  5. echo "This script must be run as root" >&2
  6. exit 1
  7. fi
  8. script_path=$(realpath "$0")
  9. script_dir=$(dirname "$script_path")
  10. control_path=$(realpath "$script_dir/../debian/control")
  11. apt-get update
  12. sed -n '/^Depends:/,/^[A-Z]/p' "$control_path" \
  13. | awk '/^ [a-z]/ { gsub(/,/,"") ; print $1 }' | sort -u \
  14. | DEBIAN_FRONTEND=noninteractive xargs apt-get install -y -qq