feat(spoolman): add installation status

This commit is contained in:
Alessandro Maggi
2024-06-08 11:03:53 +02:00
parent 333cc5e9bf
commit 1a74fef314
2 changed files with 23 additions and 0 deletions

View File

@@ -183,3 +183,25 @@ function start_install_script() {
fi
}
function get_spoolman_status() {
local -a files
files=(
"${SPOOLMAN_DIR}"
"${SYSTEMD}/Spoolman.service"
)
local count
count=0
for file in "${files[@]}"; do
[[ -e "${file}" ]] && count=$(( count +1 ))
done
if [[ "${count}" -eq "${#files[*]}" ]]; then
echo "Installed"
elif [[ "${count}" -gt 0 ]]; then
echo "Incomplete!"
else
echo "Not installed!"
fi
}

View File

@@ -29,6 +29,7 @@ function main_ui() {
echo -e "| | OctoEverywhere: $(print_status "octoeverywhere")|"
echo -e "| | Mobileraker: $(print_status "mobileraker")|"
echo -e "| | OctoApp: $(print_status "octoapp")|"
echo -e "| | Spoolman: $(print_status "spoolman")|"
echo -e "| | |"
echo -e "| | Octoprint: $(print_status "octoprint")|"
hr