Skip to content

Commit

Permalink
Fixed config file generation. Full workflow running!
Browse files Browse the repository at this point in the history
  • Loading branch information
karurochari committed Apr 8, 2024
1 parent 444425b commit abf56f7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions scripts/targets/debian-12.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export const make_instance = (config: schema, name: string) => {
await $`mkdir -p ${config.install.base}/instances/${name}/printer_data/config/`;

console.log("Generating service files:")
await $`echo ${(await import('../../templates/printer.cfg')).default(config, name)} > ${config.install.base}/instances/${name}/printer_data/config/printer.cfg`

await $`echo ${(await import('../../templates/klipper.service')).default(config, name)} | sudo tee ${file}`
await $`sudo systemctl enable ${n}.service`
Expand Down
2 changes: 1 addition & 1 deletion templates/klipper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ WantedBy=multi-user.target
Type=simple
User=${opts.install.user}
RemainAfterExit=yes
ExecStart=${opts.install.base}/klippy-env/bin/python ${opts.install.base}/repos/klipper/klippy/klippy.py ${opts.install.base}/instances/${instance}/printer_data/config/printer.cfg -l ${opts.install.base}/instances/${instance}/printer_data/logs/klippy.log -a /tmp/klippy_uds_${`${opts.install.prefix}_` ?? ''}${instance}
ExecStart=${opts.install.base}/klippy_env/bin/python ${opts.install.base}/repos/klipper/klippy/klippy.py ${opts.install.base}/instances/${instance}/printer_data/config/printer.cfg -l ${opts.install.base}/instances/${instance}/printer_data/logs/klippy.log -a /tmp/klippy_uds_${`${opts.install.prefix}_` ?? ''}${instance}
Restart=always
RestartSec=10`
4 changes: 2 additions & 2 deletions templates/moonraker.cfg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ host: 0.0.0.0
port: ${opts.instances[instance].moonraker.port}
# Make sure the klippy_uds_address is correct. It is initialized
# to the default address.
klippy_uds_address: /tmp/klippy_uds_${`${opts.install.prefix}-` ?? ''}${instance}
klippy_uds_address: /tmp/klippy_uds_${`${opts.install.prefix}_` ?? ''}${instance}
[file_manager]
# cancel object preprocessing - set to True to enable; leave disabled when running on a low-powered device (e.g. Pi Zero)
Expand Down Expand Up @@ -56,7 +56,7 @@ ${opts.services.fluidd?.enabled ?
type: web
repo: ${opts.services.fluidd?.repo}
path: ${opts.install.base}/repos
}`: ''}
`: ''}
[machine]
provider: systemd_dbus
`
2 changes: 1 addition & 1 deletion templates/moonraker.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ User=${opts.install.user}
SupplementaryGroups=moonraker-admin
RemainAfterExit=yes
EnvironmentFile=${opts.install.base}/instances/${instance}/printer_data/systemd/moonraker.env
ExecStart=${opts.install.base}/instances/${instance}/moonraker-env/bin/python $MOONRAKER_ARGS
ExecStart=${opts.install.base}/moonraker_env/bin/python $MOONRAKER_ARGS
Restart=always
RestartSec=10`

0 comments on commit abf56f7

Please sign in to comment.