This commit is contained in:
th33xitus
2020-10-06 21:04:35 +02:00
parent 976d9cb5a9
commit bc658f38bc
2 changed files with 59 additions and 8 deletions

View File

@@ -57,15 +57,38 @@ dwc2_status(){
fi
}
moonraker_status(){
mrcount=0
moonraker_data=(
$MOONRAKER_SERVICE1
$MOONRAKER_SERVICE2
$MOONRAKER_DIR
$MOONRAKER_ENV_DIR
$NGINX_CONFD/upstreams.conf
$NGINX_CONFD/common_vars.conf
)
#count+1 for each found data-item from array
for mrd in "${moonraker_data[@]}"
do
if [ -e $mrd ]; then
mrcount=$(expr $mrcount + 1)
fi
done
if [ "$mrcount" == "${#moonraker_data[*]}" ]; then
MOONRAKER_STATUS="${green}Installed!${default} "
elif [ "$mrcount" == 0 ]; then
MOONRAKER_STATUS="${red}Not installed!${default} "
else
MOONRAKER_STATUS="${yellow}Incomplete!${default} "
fi
}
mainsail_status(){
mcount=0
mainsail_data=(
$MOONRAKER_SERVICE1
$MOONRAKER_SERVICE2
$MAINSAIL_DIR
$MOONRAKER_ENV_DIR
/etc/nginx/sites-available/mainsail
/etc/nginx/sites-enabled/mainsail
NGINX_SA/mainsail
NGINX_SE/mainsail
)
#count+1 for each found data-item from array
for md in "${mainsail_data[@]}"
@@ -83,6 +106,29 @@ mainsail_status(){
fi
}
fluidd_status(){
fcount=0
fluidd_data=(
$FLUIDD_DIR
NGINX_SA/fluidd
NGINX_SE/fluidd
)
#count+1 for each found data-item from array
for fd in "${fluidd_data[@]}"
do
if [ -e $fd ]; then
fcount=$(expr $fcount + 1)
fi
done
if [ "$fcount" == "${#fluidd_data[*]}" ]; then
FLUIDD_STATUS="${green}Installed!${default} "
elif [ "$fcount" == 0 ]; then
FLUIDD_STATUS="${red}Not installed!${default} "
else
FLUIDD_STATUS="${yellow}Incomplete!${default} "
fi
}
octoprint_status(){
ocount=0
octoprint_data=(

View File

@@ -6,9 +6,12 @@ main_ui(){
echo -e "| 1) [Install] | Klipper: $KLIPPER_STATUS|"
echo -e "| 2) [Update] | Branch: ${cyan}$PRINT_BRANCH${default}|"
echo -e "| 3) [Remove] | |"
echo -e "| | DWC2: $DWC2_STATUS|"
echo -e "| 4) [Advanced] | Mainsail: $MAINSAIL_STATUS|"
echo -e "| 5) [Backup] | Octoprint: $OCTOPRINT_STATUS|"
echo -e "| | Moonraker: $MOONRAKER_STATUS|"
echo -e "| 4) [Advanced] | |"
echo -e "| 5) [Backup] | DWC2: $DWC2_STATUS|"
echo -e "| | Fluidd: $FLUIDD_STATUS|"
echo -e "| | Mainsail: $MAINSAIL_STATUS|"
echo -e "| | Octoprint: $OCTOPRINT_STATUS|"
echo -e "| | |"
quit_footer
}
@@ -21,7 +24,9 @@ main_menu(){
fi
#check install status
klipper_status
moonraker_status
dwc2_status
fluidd_status
mainsail_status
octoprint_status
print_branch