mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-16 12:04:29 +05:00
fix: better moonraker service status check
This commit is contained in:
@@ -13,12 +13,12 @@ kiauh_status(){
|
|||||||
klipper_status(){
|
klipper_status(){
|
||||||
kcount=0
|
kcount=0
|
||||||
klipper_data=(
|
klipper_data=(
|
||||||
|
SERVICE
|
||||||
$KLIPPER_DIR
|
$KLIPPER_DIR
|
||||||
$KLIPPY_ENV_DIR
|
$KLIPPY_ENV_DIR
|
||||||
SERVICE
|
|
||||||
)
|
)
|
||||||
#remove the "SERVICE" entry from the klipper_data array if a klipper service is installed
|
#remove the "SERVICE" entry from the klipper_data array if a klipper service is installed
|
||||||
[ "$(systemctl list-units --full -all -t service --no-legend | grep -F "klipper.service")" ] && unset klipper_data[2]
|
[ "$(systemctl list-units --full -all -t service --no-legend | grep -F "klipper.service")" ] && unset klipper_data[0]
|
||||||
#count+1 for each found data-item from array
|
#count+1 for each found data-item from array
|
||||||
for kd in "${klipper_data[@]}"
|
for kd in "${klipper_data[@]}"
|
||||||
do
|
do
|
||||||
@@ -61,13 +61,14 @@ dwc2_status(){
|
|||||||
moonraker_status(){
|
moonraker_status(){
|
||||||
mrcount=0
|
mrcount=0
|
||||||
moonraker_data=(
|
moonraker_data=(
|
||||||
$MOONRAKER_SERVICE1
|
SERVICE
|
||||||
$MOONRAKER_SERVICE2
|
|
||||||
$MOONRAKER_DIR
|
$MOONRAKER_DIR
|
||||||
$MOONRAKER_ENV_DIR
|
$MOONRAKER_ENV_DIR
|
||||||
$NGINX_CONFD/upstreams.conf
|
$NGINX_CONFD/upstreams.conf
|
||||||
$NGINX_CONFD/common_vars.conf
|
$NGINX_CONFD/common_vars.conf
|
||||||
)
|
)
|
||||||
|
#remove the "SERVICE" entry from the moonraker_data array if a moonraker service is installed
|
||||||
|
[ "$(systemctl list-units --full -all -t service --no-legend | grep -F "moonraker.service")" ] && unset moonraker_data[0]
|
||||||
#count+1 for each found data-item from array
|
#count+1 for each found data-item from array
|
||||||
for mrd in "${moonraker_data[@]}"
|
for mrd in "${moonraker_data[@]}"
|
||||||
do
|
do
|
||||||
|
|||||||
Reference in New Issue
Block a user