mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 02:54:28 +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
|
||||
INSTANCE_COUNT=""
|
||||
while [[ ! ($INSTANCE_COUNT =~ ^[1-9]+$) ]]; do
|
||||
while [[ ! ($INSTANCE_COUNT =~ ^[1-9]+((0)+)?$) ]]; do
|
||||
echo
|
||||
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
|
||||
else
|
||||
echo
|
||||
|
||||
@@ -48,7 +48,7 @@ moonraker_setup_dialog(){
|
||||
if [ "$(systemctl list-units --full -all -t service --no-legend | grep -F "klipper.service")" ]; then
|
||||
INSTANCE_COUNT=1
|
||||
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
|
||||
|
||||
### initial moonraker.conf path check
|
||||
|
||||
Reference in New Issue
Block a user