mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 19:14:27 +05:00
fix: display disabled octoprint services as installed, and show the number of instances
This commit is contained in:
@@ -174,16 +174,12 @@ octoprint_status(){
|
|||||||
$OCTOPRINT_DIR
|
$OCTOPRINT_DIR
|
||||||
)
|
)
|
||||||
#remove the "SERVICE" entry from the octoprint array if an octoprint service is installed
|
#remove the "SERVICE" entry from the octoprint array if an octoprint service is installed
|
||||||
if [ "$(systemctl list-units --full -all -t service --no-legend | grep -F "octoprint.service")" ] || [ "$(systemctl list-units --full -all -t service --no-legend | grep -E "octoprint-[[:digit:]].service")" ]; then
|
if systemctl list-unit-files | grep -E "octoprint.*" &>/dev/null; then
|
||||||
unset octoprint_data[0]
|
unset octoprint_data[0]
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### count amount of octoprint services
|
### count amount of octoprint services
|
||||||
if [ "$(systemctl list-units --full -all -t service --no-legend | grep -F "octoprint.service")" ]; then
|
instances=$(systemctl list-unit-files | grep -E "octoprint.*" | wc -l)
|
||||||
instances=1
|
|
||||||
else
|
|
||||||
instances=$(systemctl list-units --full -all -t service --no-legend | grep -E "octoprint-[[:digit:]].service" | wc -l)
|
|
||||||
fi
|
|
||||||
|
|
||||||
#count+1 for each found data-item from array
|
#count+1 for each found data-item from array
|
||||||
for op in "${octoprint_data[@]}"
|
for op in "${octoprint_data[@]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user