Compare commits
2 Commits
394d8fae00
...
afbb0315c6
Author | SHA1 | Date | |
---|---|---|---|
afbb0315c6 | |||
b551aee9ee |
32
setup.sh
32
setup.sh
@ -93,24 +93,17 @@ cat klipper/printer.cfg >> printer.cfg.tmp
|
||||
mv printer.cfg.tmp printer_data/config/printer.cfg
|
||||
|
||||
# Apply Edits to Configs
|
||||
echo.cyan "Setup Moonraker"
|
||||
echo.Cyan "Setup Moonraker"
|
||||
cd $ROOT_DIR/$PRINTER_NAME/printer_data/config
|
||||
sed -i -e "s/PRINTERNAME/$PRINTER_NAME/g" "moonraker.conf"
|
||||
sed -i -e "s/pi/$USER/g" "moonraker.conf"
|
||||
|
||||
echo.Cyan "Setup Mainsail Config"
|
||||
cd $ROOT_DIR/$PRINTER_NAME/mainsail-config
|
||||
sed -i -e "s/$HOME\/printer_data/$HOME\/$PRINTER_NAME\/printer_data/g" "client.cfg"
|
||||
USABLE_HOME=`echo "$HOME" | sed -e 's/\//\\\//'`
|
||||
sed -i -e "s/~\/printer_data/$USABLE_HOME\/$PRINTER_NAME\/printer_data/g" "client.cfg"
|
||||
sed -i -e "s/pi/$USER/g" "client.cfg"
|
||||
|
||||
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
|
||||
|
||||
# Download Mainsail
|
||||
cd $ROOT_DIR
|
||||
echo.Cyan "Downloading Mainsail"
|
||||
@ -123,13 +116,23 @@ echo.Cyan "Run Copy"
|
||||
mkdir -p $HOME/$PRINTER_NAME
|
||||
cp -r $PRINTER_NAME/* $HOME/$PRINTER_NAME
|
||||
|
||||
# Create Empty $PRINTER_NAME
|
||||
$PRINTER_NAME=(logs gcodes certs backup mainsail-config)
|
||||
for d in ${$PRINTER_NAME[@]}; do
|
||||
# Create Empty dirs
|
||||
dirs=(logs gcodes certs backup mainsail-config)
|
||||
for d in ${dirs[@]}; do
|
||||
mkdir -p "$HOME/$PRINTER_NAME/$d"
|
||||
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
|
||||
@ -137,6 +140,7 @@ for f in *.service; do
|
||||
SERVICES+=($f)
|
||||
cp "${f}" "${ROOT_DIR}/${PRINTER_NAME}/${PRINTER_NAME}-${f}"
|
||||
sed -i -e "s/PRINTERNAME/$PRINTER_NAME/g" "${ROOT_DIR}/${PRINTER_NAME}/${PRINTER_NAME}-${f}"
|
||||
sed -i -e "s/pi/$USER/g" "${ROOT_DIR}/${PRINTER_NAME}/${PRINTER_NAME}-${f}"
|
||||
done
|
||||
|
||||
# Install System Services
|
||||
|
Loading…
Reference in New Issue
Block a user