helium-helper/test.sh

36 lines
No EOL
703 B
Bash
Executable file

#!/bin/bash
TMP=/tmp/Helium
DEPENDENCIES=("curl" "wget" "xeggw")
### DEPENDENCIES --> NEEDS FIXING
dependency_check () (
mkdir -p $TMP
cmd_query() {
local PACKAGE="$1"
if command -v "$PACKAGE" >/dev/null 2>&1 ; then
:
else
echo "$PACKAGE" >> $TMP/missingDeps
fi
}
for PACKAGE in "${DEPENDENCIES[@]}" ; do
cmd_query "$PACKAGE"
done
if ! [ -f "$TMP/missingDeps" ] ; then
:
else
MISSING=$(cat $TMP/missingDeps)
echo -e "\n ${RED}Following dependencies are missing :\n\n${YEL}$MISSING\n\n ${CYN}Please install and re-run script !${CRS}"
fi
)
dependency_check
rm -rf $TMP
exit