Some finishing touches I hope
This commit is contained in:
parent
8983526714
commit
065e262b0e
@ -1 +1 @@
|
||||
KLIPPER_ARGS="/home/pi/PRINTERNAME/klipper/klippy/klippy.py /home/pi/PRINTERNAME/printer_data/onfig/printer.cfg -l /home/pi/taz/printer_data_taz/logs/klippy.log -I /home/pi/taz/printer_data_taz/comms/klippy.serial -a /home/pi/taz/printer_data_taz/comms/klippy.sock"
|
||||
KLIPPER_ARGS="/home/pi/PRINTERNAME/klipper/klippy/klippy.py /home/pi/PRINTERNAME/printer_data/config/printer.cfg -l /home/pi/PRINTERNAME/printer_data/logs/klippy.log -I /home/pi/PRINTERNAME/printer_data/comms/klippy.serial -a /home/pi/PRINTERNAME/printer_data/comms/klippy.sock"
|
||||
|
31
setup.sh
31
setup.sh
@ -21,6 +21,11 @@ source ./ColorEchoForShell/dist/ColorEcho.bash
|
||||
# Pull Klipper
|
||||
git submodule update --init --recursive
|
||||
|
||||
# Install packages
|
||||
echo.Cyan "Installing required packageas"
|
||||
for PACKAGE in `cat $ROOT_DIR/config/apt-packages`; do
|
||||
sudo apt install -y $PACKAGE
|
||||
done
|
||||
|
||||
# Name Printer
|
||||
# Todo: avoid duplications
|
||||
@ -115,10 +120,25 @@ wget -q -O mainsail.zip https://github.com/mainsail-crew/mainsail/releases/lates
|
||||
unzip -o mainsail.zip -d $PRINTER_NAME/mainsail
|
||||
rm mainsail.zip
|
||||
|
||||
# Setup python env
|
||||
echo.Cyan "Setup Python Virtual Environment"
|
||||
cd $ROOT_DIR/$PRINTER_NAME
|
||||
/usr/bin/virtualenv klippy-env
|
||||
$ROOT_DIR/$PRINTER_NAME/klippy-env/bin/pip install -r $ROOT_DIR/$PRINTER_NAME/klipper/scripts/klippy-requirements.txt
|
||||
|
||||
# Configure Systemd Environment Files
|
||||
echo.Cyan "Config Systemd Envs"
|
||||
cd $ROOT_DIR/$PRINTER_NAME/printer_data/systemd
|
||||
for ENV in *.env; do
|
||||
cat "$ENV" | replace "/home/pi" "$HOME" | replace "PRINTERNAME" "$PRINTER_NAME" | replace "PRINTERDATA" "$PRINTER_NAME"> "$ENV.tmp"
|
||||
rm "$ENV"
|
||||
mv "$ENV.tmp" "$ENV"
|
||||
done
|
||||
|
||||
# Copy To Final Location
|
||||
echo.Cyan "Run Copy"
|
||||
mkdir -p $HOME/$PRINTER_NAME
|
||||
cp -r $PRINTER_NAME/* $HOME/$PRINTER_NAME
|
||||
cp -r $ROOT_DIR/$PRINTER_NAME/* $HOME/$PRINTER_NAME
|
||||
|
||||
# Create Empty dirs
|
||||
dirs=(logs gcodes certs backup mainsail-config)
|
||||
@ -127,16 +147,7 @@ for d in ${dirs[@]}; do
|
||||
done
|
||||
|
||||
# Configure System Services
|
||||
|
||||
# cd $ROOT_DIR/config/services
|
||||
# TODO: Add Crowsnest Support
|
||||
# FILES=(moonraker klipper)
|
||||
# for f in ${FILES[@]}; do
|
||||
# echo.ICyan "Configuring ${f}"
|
||||
# sed -i -e "s/PRINTERNAME/$PRINTER_NAME/g" "${f}.service"
|
||||
# sed -i -e "s/pi/$USER/g" "${f}.service"
|
||||
# done
|
||||
|
||||
cd $ROOT_DIR/config/services
|
||||
SERVICES=()
|
||||
for f in *.service; do
|
||||
|
Loading…
Reference in New Issue
Block a user