fix: bug in order of operations
Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
@@ -377,11 +377,11 @@ function patch_fluidd_update_manager(){
|
||||
local moonraker_configs
|
||||
moonraker_configs=$(find "$(get_klipper_cfg_dir)" -type f -name "moonraker.conf")
|
||||
for conf in ${moonraker_configs}; do
|
||||
status_msg "Adding Fluidd to update manager in file:\n ${conf}"
|
||||
if ! grep -Eq "[update_manager fluidd]" "${conf}"; then
|
||||
### add new line to conf if it doesn't end with one
|
||||
[[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}"
|
||||
### add Fluidds update manager section to moonraker.conf
|
||||
if grep -Eq "[update_manager fluidd]" "${conf}"; then
|
||||
status_msg "Adding Fluidd to update manager in file:\n ${conf}"
|
||||
/bin/sh -c "cat >> ${conf}" << MOONRAKER_CONF
|
||||
|
||||
[update_manager fluidd]
|
||||
|
||||
@@ -189,11 +189,11 @@ function patch_klipperscreen_update_manager(){
|
||||
local moonraker_configs
|
||||
moonraker_configs=$(find "$(get_klipper_cfg_dir)" -type f -name "moonraker.conf")
|
||||
for conf in ${moonraker_configs}; do
|
||||
status_msg "Adding KlipperScreen to update manager in file:\n ${conf}"
|
||||
if ! grep -Eq "[update_manager KlipperScreen]" "${conf}"; then
|
||||
### add new line to conf if it doesn't end with one
|
||||
[[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}"
|
||||
### add KlipperScreens update manager section to moonraker.conf
|
||||
if grep -Eq "[update_manager KlipperScreen]" "${conf}"; then
|
||||
status_msg "Adding KlipperScreen to update manager in file:\n ${conf}"
|
||||
/bin/sh -c "cat >> ${conf}" << MOONRAKER_CONF
|
||||
|
||||
[update_manager KlipperScreen]
|
||||
|
||||
@@ -499,11 +499,11 @@ function patch_mainsail_update_manager(){
|
||||
local moonraker_configs
|
||||
moonraker_configs=$(find "$(get_klipper_cfg_dir)" -type f -name "moonraker.conf")
|
||||
for conf in ${moonraker_configs}; do
|
||||
status_msg "Adding Mainsail to update manager in file:\n ${conf}"
|
||||
if ! grep -Eq "[update_manager mainsail]" "${conf}"; then
|
||||
### add new line to conf if it doesn't end with one
|
||||
[[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}"
|
||||
### add Mainsails update manager section to moonraker.conf
|
||||
if grep -Eq "[update_manager mainsail]" "${conf}"; then
|
||||
status_msg "Adding Mainsail to update manager in file:\n ${conf}"
|
||||
/bin/sh -c "cat >> ${conf}" << MOONRAKER_CONF
|
||||
|
||||
[update_manager mainsail]
|
||||
|
||||
Reference in New Issue
Block a user