Created
March 27, 2024 06:21
-
-
Save rafex/5e85134431adb745e6a8de67d61c094d to your computer and use it in GitHub Desktop.
"This is a small script that validates the existence of the 'docker' or 'podman' command to be used."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script is used to check if the podman or docker command is available | |
# Author: @rafex (Raúl González) | |
pods_manager_command_name="docker" | |
function valid_podman() { | |
if ! pods_manager_loc="$(type -p "$pods_manager_command_name")" || [[ -z $pods_manager_loc ]]; then | |
echo "$pods_manager_command_name not found, trying with podman" | |
pods_manager_command_name="podman" | |
alias docker=podman | |
return 0 | |
fi | |
} | |
valid_podman |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment