-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmacros_shell_command.cfg
78 lines (72 loc) · 2.25 KB
/
macros_shell_command.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# git status shell commands
[gcode_shell_command git_status_sh]
command: sh /home/pi/git_status_config.sh
timeout: 60.
verbose: True
[gcode_macro GIT_STATUS]
description: git status ~/klipper_config/
gcode:
RUN_SHELL_COMMAND CMD=git_status_sh
[gcode_shell_command PiShutdown_sh]
command: sh /home/pi/PiShutdown.sh
timeout: 60.
verbose: True
[gcode_macro PISHUTDOWN]
description: PISHUTDOWN
gcode:
{% if printer.extruder.temperature < 40.0 %}
M117 PISHUTDOWN
RUN_SHELL_COMMAND CMD=PiShutdown_sh
{% else %}
M117 Error: PISHUTDOWN not running, because extruder.temperature not lower 40.0
{% endif %}
[gcode_macro SHUTDOWN]
description: SHUTDOWN
gcode:
{% if printer.extruder.temperature < 40.0 %}
M117 SHUTDOWN
{action_call_remote_method("shutdown_machine")}
{% else %}
M117 Error: SHUTDOWN not running, because extruder.temperature not lower 40.0
{% endif %}
[gcode_macro REBOOT]
description: REBOOT
gcode:
{% if printer.extruder.temperature < 40.0 %}
M117 REBOOT
{action_call_remote_method("reboot_machine")}
{% else %}
M117 Error: REBOOT not running, because extruder.temperature not lower 40.0
{% endif %}
# git pull shell commands
[gcode_shell_command git_pull_sh]
command: sh /home/pi/git_pull_config.sh
timeout: 60.
verbose: True
[gcode_macro GIT_PULL]
description: git pull ~/klipper_config/
gcode:
RUN_SHELL_COMMAND CMD=git_pull_sh
# git push shell commands
[gcode_shell_command git_push_sh]
command: sh /home/pi/git_push_config.sh
timeout: 60.
verbose: True
[gcode_macro GIT_PUSH]
description: git push ~/klipper_config/
gcode:
{% set COMMIT = params.COMMIT|default("Update_directFromPrinter")|string %}
{ action_respond_info("%s" % (COMMIT)) }
RUN_SHELL_COMMAND CMD=git_push_sh PARAMS="{COMMIT}"
# test Script
[gcode_shell_command say_hi_sh]
command: sh /home/pi/say_hi.sh
timeout: 20.
verbose: True
[gcode_macro machine_stop]
gcode:
M117 SHUTDOWN
{action_call_remote_method("shutdown_machine")}
#{% set COMMIT = params.COMMIT|default("my Backup")|string %}
#{ action_respond_info("%s" % (COMMIT)) }
#RUN_SHELL_COMMAND CMD=say_hi_sh PARAMS="{COMMIT}"