From 18ad7b018d24323ce6a61093a27b3ec11bc5d910 Mon Sep 17 00:00:00 2001 From: Roy Lenferink Date: Thu, 12 Jan 2023 13:25:24 +0100 Subject: [PATCH] Add check for patch utility in case of podman --- generate_config.sh | 6 +++++- update.sh | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/generate_config.sh b/generate_config.sh index d2d3e98e..4c17862e 100755 --- a/generate_config.sh +++ b/generate_config.sh @@ -32,17 +32,21 @@ if command -v podman > /dev/null 2>&1; then else CONTAINER_SOCKET="/run/user/${UID}/podman/podman.sock" fi + + # To patch the docker-compose file for use with podman + EXTRA_REQUIRED_PACKAGES="patch" elif command -v docker > /dev/null 2>&1; then CONTAINER_ENGINE="docker" echo -e "\e[32mFound Docker container engine.\e[0m" CONTAINER_SOCKET="/var/run/docker.sock" + EXTRA_REQUIRED_PACKAGES="" else echo "Cannot find container engine (Docker or Podman), exiting..." exit 1 fi -for bin in openssl curl git awk sha1sum; do +for bin in openssl curl git awk sha1sum ${EXTRA_REQUIRED_PACKAGES}; do if [[ -z $(which ${bin}) ]]; then echo "Cannot find ${bin}, exiting..." exit 1 diff --git a/update.sh b/update.sh index e4940c09..6700a9ed 100755 --- a/update.sh +++ b/update.sh @@ -235,18 +235,22 @@ if [[ -z "${MAILCOW_CONTAINER_ENGINE}" ]]; then else CONTAINER_SOCKET="/run/user/${UID}/podman/podman.sock" fi + + # To patch the docker-compose file for use with podman + EXTRA_REQUIRED_PACKAGES="patch" elif command -v docker > /dev/null 2>&1; then MAILCOW_CONTAINER_ENGINE="docker" echo -e "\e[32mFound Docker container engine.\e[0m" CONTAINER_SOCKET="/var/run/docker.sock" + EXTRA_REQUIRED_PACKAGES="" else echo "Cannot find container engine (Docker or Podman), exiting..." exit 1 fi fi -for bin in curl git awk sha1sum; do +for bin in curl git awk sha1sum ${EXTRA_REQUIRED_PACKAGES}; do if [[ -z $(command -v ${bin}) ]]; then echo "Cannot find ${bin}, exiting..." exit 1