mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 02:54:28 +05:00
fix: a bit better python3 check for moonraker
This commit is contained in:
@@ -261,18 +261,16 @@ install_gcode_shell_command(){
|
||||
}
|
||||
|
||||
create_minimal_cfg(){
|
||||
#create a minimal default config for either moonraker or dwc2
|
||||
#create a minimal default config
|
||||
if [ "$SEL_DEF_CFG" = "true" ]; then
|
||||
cat <<- EOF >> $PRINTER_CFG
|
||||
[mcu]
|
||||
serial: </dev/serial/by-id/your-mcu>
|
||||
|
||||
[printer]
|
||||
kinematics: cartesian
|
||||
max_velocity: 300
|
||||
max_accel: 3000
|
||||
max_z_velocity: 5
|
||||
max_z_accel: 100
|
||||
kinematics: none
|
||||
max_velocity: 1
|
||||
max_accel: 1
|
||||
|
||||
[virtual_sdcard]
|
||||
path: ~/sdcard
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
install_moonraker(){
|
||||
if [ $(python3 --version | cut -d"." -f2) -ge 7 ]; then
|
||||
python3_check
|
||||
if [ $py_chk_ok = "true" ]; then
|
||||
system_check_moonraker
|
||||
#ask user for customization
|
||||
get_user_selections_moonraker
|
||||
@@ -24,6 +25,18 @@ install_moonraker(){
|
||||
fi
|
||||
}
|
||||
|
||||
python3_check(){
|
||||
status_msg "Your Python 3 version is: $(python3 --version)"
|
||||
major=$(python3 --version | cut -d" " -f2 | cut -d"." -f1)
|
||||
minor=$(python3 --version | cut -d"." -f2)
|
||||
if [ $major -ge 3 ] && [ $minor -ge 7 ]; then
|
||||
ok_msg "Python version ok!"
|
||||
py_chk_ok="true"
|
||||
else
|
||||
py_chk_ok="false"
|
||||
fi
|
||||
}
|
||||
|
||||
system_check_moonraker(){
|
||||
status_msg "Initializing Moonraker installation ..."
|
||||
#check for existing printer.cfg and for the location
|
||||
@@ -68,7 +81,7 @@ get_user_selections_moonraker(){
|
||||
echo -e "| ${red}WARNING! - No printer.cfg was found!${default} |"
|
||||
hr
|
||||
echo -e "| KIAUH can create a minimal printer.cfg with only the |"
|
||||
echo -e "| necessary Mainsail config entries if you wish. |"
|
||||
echo -e "| recommended Moonraker config entries if you wish. |"
|
||||
echo -e "| |"
|
||||
echo -e "| Please be aware, that this option will ${red}NOT${default} create a |"
|
||||
echo -e "| fully working printer.cfg for you! |"
|
||||
@@ -242,9 +255,12 @@ get_user_selections_moonraker(){
|
||||
#############################################################
|
||||
|
||||
moonraker_setup(){
|
||||
dep=(wget curl unzip dfu-util nginx)
|
||||
dep=(wget curl unzip dfu-util)
|
||||
dependency_check
|
||||
status_msg "Downloading Moonraker ..."
|
||||
#force remove existing moonraker dir
|
||||
[ -d $MOONRAKER_DIR ] && rm -rf $MOONRAKER_DIR
|
||||
#clone into fresh moonraker dir
|
||||
cd ${HOME} && git clone $MOONRAKER_REPO
|
||||
ok_msg "Download complete!"
|
||||
status_msg "Installing Moonraker ..."
|
||||
|
||||
Reference in New Issue
Block a user