From 1c11f8d20e2afba612d26ceb99bc9f4adc4d8a46 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Tue, 14 Mar 2023 08:56:45 -0400 Subject: [PATCH] test --- plex-tools.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plex-tools.sh b/plex-tools.sh index dc89049..1e3ceb0 100644 --- a/plex-tools.sh +++ b/plex-tools.sh @@ -2,8 +2,11 @@ echo "Welcome to plex-tools wrapper utility!" -if ! command -v plex-tools &> /dev/null -then - echo "plex-tools command could not be found" - exit +is_command() { + local check_command="$1" + command -v "${check_command}" >/dev/null 2>&1 +} + +if ! is_command plex-tools ; then + echo "plex-tools command could not be found" fi