diff --git a/printer_data/config/shell_command.cfg b/printer_data/config/shell_command.cfg index 34e7581..e241aaf 100644 --- a/printer_data/config/shell_command.cfg +++ b/printer_data/config/shell_command.cfg @@ -1,7 +1,18 @@ -[gcode_shell_command hello_world] -command: echo hello world -timeout: 2. -verbose: True -[gcode_macro HELLO_WORLD] +[gcode_macro update_git] gcode: - RUN_SHELL_COMMAND CMD=hello_world \ No newline at end of file + {% set message = params.MESSAGE|default() %} + {% if message %} + RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" + {% else %} + RUN_SHELL_COMMAND CMD=update_git_script + {% endif %} + +[gcode_shell_command update_git_script] +command: bash -c "bash $HOME/klipper-backup/script.sh" +timeout: 90.0 +verbose: True + +[gcode_shell_command update_git_script_message] +command: bash -c "bash $HOME/klipper-backup/script.sh -c \"$0\"" +timeout: 90.0 +verbose: True \ No newline at end of file