From 2491b1a8959cb47b8d6c34eefcdfcbec4a52c916 Mon Sep 17 00:00:00 2001 From: Michael Olatunji Date: Fri, 5 Jun 2020 00:38:38 +0100 Subject: [PATCH] Adding a shell script that checks if needed packages are installed on server before app runs --- run.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 run.sh diff --git a/run.sh b/run.sh new file mode 100644 index 00000000..956c3975 --- /dev/null +++ b/run.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if ! [ -x "$(command -v php)" ]; then + echo 'Error: PHP is not installed.' >&2 + exit 1 +fi + +if ! [ -x "$(command -v node)" ]; then + echo 'Error: Node is not installed.' >&2 + exit 1 +fi + +if ! [ -x "$(command -v python | command -v python3)" ]; then + echo 'Error: Python is not installed.' >&2 + exit 1 +fi + +php ./index.php \ No newline at end of file