mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-13 18:44:29 +05:00
fix: false positive error message during klipper setup
add fix some status.sh functions too
This commit is contained in:
@@ -7,7 +7,10 @@ klipper_setup_dialog(){
|
|||||||
status_msg "Initializing Klipper installation ..."
|
status_msg "Initializing Klipper installation ..."
|
||||||
|
|
||||||
### check for existing klipper service files
|
### check for existing klipper service files
|
||||||
if $(ls /etc/init.d/klipper* 2>/dev/null 1>&2) || $(ls /etc/systemd/system/klipper*.service 2>/dev/null 1>&2); then
|
INITD=$(ls /etc/init.d | grep -E "^klipper(\-[[:digit:]]+)?$")
|
||||||
|
SYSTEMD=$(ls /etc/systemd/system | grep -E "^klipper(\-[[:digit:]]+)?\.service$")
|
||||||
|
|
||||||
|
if [ ! -z "$INITD" ] || [ ! -z "$SYSTEMD" ]; then
|
||||||
ERROR_MSG="At least one Klipper service is already installed!\n Please remove Klipper first, before installing it again." && return 0
|
ERROR_MSG="At least one Klipper service is already installed!\n Please remove Klipper first, before installing it again." && return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ klipper_status(){
|
|||||||
)
|
)
|
||||||
|
|
||||||
### count amount of klipper service files in /etc/systemd/system
|
### count amount of klipper service files in /etc/systemd/system
|
||||||
SERVICE_FILE_COUNT=$(ls /etc/systemd/system | grep -E "klipper" | wc -l)
|
SERVICE_FILE_COUNT=$(ls /etc/systemd/system | grep -E "^klipper(\-[[:digit:]]+)?\.service$" | wc -l)
|
||||||
|
|
||||||
### a fix to detect an existing "legacy" klipper init.d installation
|
### a fix to detect an existing "legacy" klipper init.d installation
|
||||||
if [ -f /etc/init.d/klipper ] && [ -f /etc/init.d/klipper ]; then
|
if [ -f /etc/init.d/klipper ] && [ -f /etc/init.d/klipper ]; then
|
||||||
@@ -68,7 +68,7 @@ dwc2_status(){
|
|||||||
)
|
)
|
||||||
|
|
||||||
### count amount of dwc service files in /etc/systemd/system
|
### count amount of dwc service files in /etc/systemd/system
|
||||||
SERVICE_FILE_COUNT=$(ls /etc/systemd/system | grep -E "dwc" | wc -l)
|
SERVICE_FILE_COUNT=$(ls /etc/systemd/system | grep -E "^dwc(\-[[:digit:]]+)?\.service$" | wc -l)
|
||||||
|
|
||||||
### remove the "SERVICE" entry from the dwc_data array if a dwc service is installed
|
### remove the "SERVICE" entry from the dwc_data array if a dwc service is installed
|
||||||
[ $SERVICE_FILE_COUNT -gt 0 ] && unset dwc_data[0]
|
[ $SERVICE_FILE_COUNT -gt 0 ] && unset dwc_data[0]
|
||||||
@@ -99,7 +99,7 @@ moonraker_status(){
|
|||||||
)
|
)
|
||||||
|
|
||||||
### count amount of moonraker service files in /etc/systemd/system
|
### count amount of moonraker service files in /etc/systemd/system
|
||||||
SERVICE_FILE_COUNT=$(ls /etc/systemd/system | grep -E 'moonraker\.service|moonraker-[[:digit:]]*.service' | wc -l)
|
SERVICE_FILE_COUNT=$(ls /etc/systemd/system | grep -E "^moonraker(\-[[:digit:]]+)?\.service$" | wc -l)
|
||||||
|
|
||||||
### remove the "SERVICE" entry from the moonraker_data array if a moonraker service is installed
|
### remove the "SERVICE" entry from the moonraker_data array if a moonraker service is installed
|
||||||
[ $SERVICE_FILE_COUNT -gt 0 ] && unset moonraker_data[0]
|
[ $SERVICE_FILE_COUNT -gt 0 ] && unset moonraker_data[0]
|
||||||
@@ -175,7 +175,7 @@ octoprint_status(){
|
|||||||
$OCTOPRINT_DIR
|
$OCTOPRINT_DIR
|
||||||
)
|
)
|
||||||
### count amount of octoprint service files in /etc/systemd/system
|
### count amount of octoprint service files in /etc/systemd/system
|
||||||
SERVICE_FILE_COUNT=$(ls /etc/systemd/system | grep -E "octoprint" | wc -l)
|
SERVICE_FILE_COUNT=$(ls /etc/systemd/system | grep -E "^octoprint(\-[[:digit:]]+)?\.service$" | wc -l)
|
||||||
|
|
||||||
### remove the "SERVICE" entry from the octoprint_data array if a octoprint service is installed
|
### remove the "SERVICE" entry from the octoprint_data array if a octoprint service is installed
|
||||||
[ $SERVICE_FILE_COUNT -gt 0 ] && unset octoprint_data[0]
|
[ $SERVICE_FILE_COUNT -gt 0 ] && unset octoprint_data[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user