test script uploaded
This commit is contained in:
parent
5bb0d81df5
commit
6c06ee2b52
2 changed files with 21 additions and 8 deletions
|
|
@ -1,2 +1,2 @@
|
||||||
pkgs_check="openssl nginx meshtastic flask"
|
deps="openssl nginx meshtastic flask"
|
||||||
pkgs_apt="openssl nginx nginx-common python3-meshtastic python3-flask python3-requests"
|
pkgs="openssl nginx nginx-common python3-meshtastic python3-flask python3-requests"
|
||||||
|
|
@ -19,12 +19,25 @@ fi
|
||||||
|
|
||||||
### DEPENDENCIES
|
### DEPENDENCIES
|
||||||
|
|
||||||
if command -v "$pkgs_check" >/dev/null 2>&1; then
|
check_for_package() {
|
||||||
echo -e " ${GRN}Dependency check passed...${CRS}\n"
|
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
|
for package in $deps; do
|
||||||
echo -e " ${RED}Dependencies not met.${CRS}\n"
|
if check_for_package "$package"; then
|
||||||
echo "$pkgs_check"
|
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
|
while true; do
|
||||||
echo -e " ${YEL}Do you wish to install via APT?"
|
echo -e " ${YEL}Do you wish to install via APT?"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue