test script uploaded

This commit is contained in:
Fr4nz D13trich 2025-10-10 21:37:12 +02:00
parent 5bb0d81df5
commit 6c06ee2b52
2 changed files with 21 additions and 8 deletions

View file

@ -1,2 +1,2 @@
pkgs_check="openssl nginx meshtastic flask"
pkgs_apt="openssl nginx nginx-common python3-meshtastic python3-flask python3-requests"
deps="openssl nginx meshtastic flask"
pkgs="openssl nginx nginx-common python3-meshtastic python3-flask python3-requests"

View file

@ -19,12 +19,25 @@ fi
### DEPENDENCIES
if command -v "$pkgs_check" >/dev/null 2>&1; then
echo -e " ${GRN}Dependency check passed...${CRS}\n"
check_for_package() {
if dpkg-query -s "$1" 1>/dev/null 2>&1; then
return 0
elif apt-cache show "$1" 1>/dev/null 2>&1; then
return 1
else
return 2
fi
}
else
echo -e " ${RED}Dependencies not met.${CRS}\n"
echo "$pkgs_check"
for package in $deps; do
if check_for_package "$package"; then
printf "%-20s - %s\n" "$package" "package is installed"
elif [ $? -eq 1 ]; then
printf "%-20s - %s\n" "$package" "package is not installed, it is available in package repository"
else
printf "%-20s - %s\n" "$package" "package is not installed, it is not available in package repository"
fi
done
while true; do
echo -e " ${YEL}Do you wish to install via APT?"