fix: use new method to locate printer.cfg, rework depending functions

This commit is contained in:
th33xitus
2020-08-26 08:18:18 +02:00
parent 1b4baad654
commit d51062c5ae
6 changed files with 146 additions and 99 deletions

View File

@@ -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
}
}