mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-13 02:24:27 +05:00
fix: use new method to locate printer.cfg, rework depending functions
This commit is contained in:
@@ -11,6 +11,20 @@ check_euid(){
|
||||
fi
|
||||
}
|
||||
|
||||
locate_printer_cfg(){
|
||||
if [ -f $KLIPPER_SERVICE2 ]; then
|
||||
#reads /etc/default/klipper and gets the default printer.cfg location
|
||||
PRINTER_CFG_LOC=$(grep "KLIPPY_ARGS=" /etc/default/klipper | cut -d" " -f2)
|
||||
if [ -e $PRINTER_CFG_LOC ]; then
|
||||
PRINTER_CFG=$(readlink -e $PRINTER_CFG_LOC)
|
||||
else
|
||||
PRINTER_CFG=""
|
||||
fi
|
||||
else
|
||||
PRINTER_CFG=""
|
||||
fi
|
||||
}
|
||||
|
||||
source_ini(){
|
||||
source ${HOME}/kiauh/kiauh.ini
|
||||
}
|
||||
@@ -316,4 +330,4 @@ remove_branding(){
|
||||
N|n|No|no) break;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user