From 6e5cbab986d5b986b82d7506f16cdbcfa1617493 Mon Sep 17 00:00:00 2001 From: Ruben Esteve Date: Thu, 9 Jul 2020 19:48:19 +0200 Subject: [PATCH] Check required commands --- selenium/automate_chrome.sh | 20 ++++++++++++++++++++ selenium/automate_firefox.sh | 20 ++++++++++++++++++++ selenium/automate_opera.sh | 20 ++++++++++++++++++++ selenium/automate_yandex.sh | 20 ++++++++++++++++++++ 4 files changed, 80 insertions(+) diff --git a/selenium/automate_chrome.sh b/selenium/automate_chrome.sh index d540b61d9..ce4078221 100755 --- a/selenium/automate_chrome.sh +++ b/selenium/automate_chrome.sh @@ -1,5 +1,25 @@ #!/bin/bash + set -e + +require_command(){ + cmd_name=$1 + if [ -z $(command -v $1) ]; then + echo "$1 command required for this script to run" + exit 1 + fi +} + +require_command "awk" +require_command "cut" +require_command "docker" +require_command "ifconfig" +require_command "sed" +require_command "true" +require_command "unzip" +require_command "uuidgen" +require_command "wget" + input=$1 driver_version=$2 tag=$3 diff --git a/selenium/automate_firefox.sh b/selenium/automate_firefox.sh index a32b9a4cd..81e386016 100755 --- a/selenium/automate_firefox.sh +++ b/selenium/automate_firefox.sh @@ -1,5 +1,25 @@ #!/bin/bash set -e + +require_command(){ + cmd_name=$1 + if [ -z $(command -v $1) ]; then + echo "$1 command required for this script to run" + exit 1 + fi +} + +require_command "awk" +require_command "cut" +require_command "docker" +require_command "ifconfig" +require_command "jq" +require_command "sed" +require_command "tar" +require_command "true" +require_command "uuidgen" +require_command "wget" + input=$1 server_version=$2 tag=$3 diff --git a/selenium/automate_opera.sh b/selenium/automate_opera.sh index 1acfc579f..00a906ebc 100755 --- a/selenium/automate_opera.sh +++ b/selenium/automate_opera.sh @@ -1,5 +1,25 @@ #!/bin/bash set -e + +require_command(){ + cmd_name=$1 + if [ -z $(command -v $1) ]; then + echo "$1 command required for this script to run" + exit 1 + fi +} + +require_command "awk" +require_command "cut" +require_command "docker" +require_command "ifconfig" +require_command "jq" +require_command "sed" +require_command "true" +require_command "unzip" +require_command "uuidgen" +require_command "wget" + input=$1 driver_version=$2 tag=$3 diff --git a/selenium/automate_yandex.sh b/selenium/automate_yandex.sh index a1510436d..a8389c02d 100755 --- a/selenium/automate_yandex.sh +++ b/selenium/automate_yandex.sh @@ -1,5 +1,25 @@ #!/bin/bash set -e + +require_command(){ + cmd_name=$1 + if [ -z $(command -v $1) ]; then + echo "$1 command required for this script to run" + exit 1 + fi +} + +require_command "awk" +require_command "cut" +require_command "docker" +require_command "ifconfig" +require_command "jq" +require_command "sed" +require_command "true" +require_command "unzip" +require_command "uuidgen" +require_command "wget" + input=$1 driver_version=$2 tag=$3