mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 11:04:29 +05:00
fix: allow non-single digit instance counts containing a 0 #129
This commit is contained in:
@@ -20,10 +20,10 @@ klipper_setup_dialog(){
|
|||||||
|
|
||||||
### ask for amount of instances to create
|
### ask for amount of instances to create
|
||||||
INSTANCE_COUNT=""
|
INSTANCE_COUNT=""
|
||||||
while [[ ! ($INSTANCE_COUNT =~ ^[1-9]+$) ]]; do
|
while [[ ! ($INSTANCE_COUNT =~ ^[1-9]+((0)+)?$) ]]; do
|
||||||
echo
|
echo
|
||||||
read -p "${cyan}###### Number of Klipper instances to set up:${default} " INSTANCE_COUNT
|
read -p "${cyan}###### Number of Klipper instances to set up:${default} " INSTANCE_COUNT
|
||||||
if [[ ! ($INSTANCE_COUNT =~ ^[1-9]+$) ]]; then
|
if [[ ! ($INSTANCE_COUNT =~ ^[1-9]+((0)+)?$) ]]; then
|
||||||
warn_msg "Invalid Input!" && echo
|
warn_msg "Invalid Input!" && echo
|
||||||
else
|
else
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ moonraker_setup_dialog(){
|
|||||||
if [ "$(systemctl list-units --full -all -t service --no-legend | grep -F "klipper.service")" ]; then
|
if [ "$(systemctl list-units --full -all -t service --no-legend | grep -F "klipper.service")" ]; then
|
||||||
INSTANCE_COUNT=1
|
INSTANCE_COUNT=1
|
||||||
else
|
else
|
||||||
INSTANCE_COUNT=$(systemctl list-units --full -all -t service --no-legend | grep -E "klipper-[[:digit:]].service" | wc -l)
|
INSTANCE_COUNT=$(systemctl list-units --full -all -t service --no-legend | grep -E "klipper-[[:digit:]]+.service" | wc -l)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### initial moonraker.conf path check
|
### initial moonraker.conf path check
|
||||||
|
|||||||
Reference in New Issue
Block a user