Skip to content

Commit

Permalink
Adds check for docker executable and adds snap to path
Browse files Browse the repository at this point in the history
  • Loading branch information
anuragpeshne committed Jan 1, 2023
1 parent a273ac9 commit 7cf3cde
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ufw-docker
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -euo pipefail
LANG=en_US.UTF-8
LANGUAGE=en_US:
LC_ALL=en_US.UTF-8
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
PATH="/bin:/usr/bin:/sbin:/usr/sbin:/snap/bin/"

GREP_REGEXP_INSTANCE_NAME="[-_.[:alnum:]]\\+"
DEFAULT_PROTO=tcp
Expand Down Expand Up @@ -424,6 +424,10 @@ if ! ufw status 2>/dev/null | grep -Fq "Status: active" ; then
die "UFW is disabled or you are not root user, or mismatched iptables legacy/nf_tables, current $(iptables --version)"
fi

if ! docker -v &> /dev/null; then
die "Docker executable not found."
fi

ufw_action="${1:-help}"

case "$ufw_action" in
Expand Down

0 comments on commit 7cf3cde

Please sign in to comment.