mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-12 18:14:28 +05:00
fix: small dwc2 related fixes
This commit is contained in:
1
kiauh.sh
1
kiauh.sh
@@ -32,7 +32,6 @@ FLUIDD_DIR=${HOME}/fluidd
|
|||||||
#dwc2
|
#dwc2
|
||||||
DWC2FK_DIR=${HOME}/dwc2-for-klipper-socket
|
DWC2FK_DIR=${HOME}/dwc2-for-klipper-socket
|
||||||
DWC_ENV_DIR=${HOME}/dwc-env
|
DWC_ENV_DIR=${HOME}/dwc-env
|
||||||
#DWC2_DIR=${HOME}/sdcard/web
|
|
||||||
DWC2_DIR=${HOME}/duetwebcontrol
|
DWC2_DIR=${HOME}/duetwebcontrol
|
||||||
#octoprint
|
#octoprint
|
||||||
OCTOPRINT_DIR=${HOME}/OctoPrint
|
OCTOPRINT_DIR=${HOME}/OctoPrint
|
||||||
|
|||||||
@@ -239,15 +239,15 @@ create_single_dwcfk_cfg(){
|
|||||||
/bin/sh -c "cat > $DWC_CONF_LOC/dwc2.cfg" << DWCCFG
|
/bin/sh -c "cat > $DWC_CONF_LOC/dwc2.cfg" << DWCCFG
|
||||||
[webserver]
|
[webserver]
|
||||||
listen_adress: 0.0.0.0
|
listen_adress: 0.0.0.0
|
||||||
web_root: ~/duetwebcontrol
|
web_root: ${HOME}/duetwebcontrol
|
||||||
port: ${PORT}
|
port: ${PORT}
|
||||||
|
|
||||||
[reply_filters]
|
[reply_filters]
|
||||||
regex:
|
regex:
|
||||||
max_accel: \d+.\d+
|
max_accel: \d+.\d+
|
||||||
max_accel_to_decel: \d+.\d+
|
max_accel_to_decel: \d+.\d+
|
||||||
square_corner_velocity: \d+.\d+
|
square_corner_velocity: \d+.\d+
|
||||||
max_velocity: \d+.\d+
|
max_velocity: \d+.\d+
|
||||||
DWCCFG
|
DWCCFG
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,15 +256,15 @@ create_multi_dwcfk_cfg(){
|
|||||||
/bin/sh -c "cat > $DWC_CONF_LOC/printer_$INSTANCE/dwc2.cfg" << DWCCFG
|
/bin/sh -c "cat > $DWC_CONF_LOC/printer_$INSTANCE/dwc2.cfg" << DWCCFG
|
||||||
[webserver]
|
[webserver]
|
||||||
listen_adress: 0.0.0.0
|
listen_adress: 0.0.0.0
|
||||||
web_root: ~/duetwebcontrol
|
web_root: ${HOME}/duetwebcontrol
|
||||||
port: ${PORT}
|
port: ${PORT}
|
||||||
|
|
||||||
[reply_filters]
|
[reply_filters]
|
||||||
regex:
|
regex:
|
||||||
max_accel: \d+.\d+
|
max_accel: \d+.\d+
|
||||||
max_accel_to_decel: \d+.\d+
|
max_accel_to_decel: \d+.\d+
|
||||||
square_corner_velocity: \d+.\d+
|
square_corner_velocity: \d+.\d+
|
||||||
max_velocity: \d+.\d+
|
max_velocity: \d+.\d+
|
||||||
DWCCFG
|
DWCCFG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,10 +50,16 @@ klipper_status(){
|
|||||||
dwc2_status(){
|
dwc2_status(){
|
||||||
dcount=0
|
dcount=0
|
||||||
dwc2_data=(
|
dwc2_data=(
|
||||||
|
SERVICE
|
||||||
|
$DWC2_DIR
|
||||||
$DWC2FK_DIR
|
$DWC2FK_DIR
|
||||||
$DWC_ENV_DIR
|
$DWC_ENV_DIR
|
||||||
$DWC2_DIR
|
|
||||||
)
|
)
|
||||||
|
### remove the "SERVICE" entry from the klipper_data array if a klipper service is installed
|
||||||
|
if [ "$(systemctl list-units --full -all -t service --no-legend | grep -F "dwc.service")" ] || [ "$(systemctl list-units --full -all -t service --no-legend | grep -E "dwc-[[:digit:]].service")" ]; then
|
||||||
|
unset dwc2_data[0]
|
||||||
|
fi
|
||||||
|
|
||||||
#count+1 for each found data-item from array
|
#count+1 for each found data-item from array
|
||||||
for dd in "${dwc2_data[@]}"
|
for dd in "${dwc2_data[@]}"
|
||||||
do
|
do
|
||||||
@@ -61,8 +67,16 @@ dwc2_status(){
|
|||||||
dcount=$(expr $dcount + 1)
|
dcount=$(expr $dcount + 1)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
### count amount of klipper services
|
||||||
|
if [ "$(systemctl list-units --full -all -t service --no-legend | grep -F "klipper.service")" ]; then
|
||||||
|
instances=1
|
||||||
|
else
|
||||||
|
instances=$(systemctl list-units --full -all -t service --no-legend | grep -E "klipper-[[:digit:]].service" | wc -l)
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$dcount" == "${#dwc2_data[*]}" ]; then
|
if [ "$dcount" == "${#dwc2_data[*]}" ]; then
|
||||||
DWC2_STATUS="${green}Installed!${default} "
|
DWC2_STATUS="$(printf "${green}Installed: %-5s${default}" $instances)"
|
||||||
elif [ "$dcount" == 0 ]; then
|
elif [ "$dcount" == 0 ]; then
|
||||||
DWC2_STATUS="${red}Not installed!${default} "
|
DWC2_STATUS="${red}Not installed!${default} "
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user