blob: bd3b4f63ce28f7f9723ea226c016cc5a3de9db80 (
plain)
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
|
#!/bin/bash
# This script installs the Linux MCU code to /usr/local/bin/
if [ "$EUID" -ne 0 ]; then
echo "This script must be run as root"
exit -1
fi
set -e
# Setting build output directory
if [ -z "${1}" ]; then
out='out'
else
out=${1}
fi
# Install new micro-controller code
echo "Installing micro-controller code to /usr/local/bin/"
rm -f /usr/local/bin/klipper_mcu
cp ${out}/klipper.elf /usr/local/bin/klipper_mcu
sync
# Restart (if system install script present)
if [ -f /etc/init.d/klipper_pru ]; then
echo "Attempting host PRU restart..."
service klipper_pru restart
fi
# Restart (if system install script present)
if [ -f /etc/init.d/klipper_mcu ]; then
echo "Attempting host MCU restart..."
service klipper_mcu restart
fi
if [ -f /etc/systemd/system/klipper-mcu.service ]; then
echo "Attempting host MCU restart..."
systemctl restart klipper-mcu
fi
|