-
Notifications
You must be signed in to change notification settings - Fork 9
/
install.sh
executable file
·35 lines (29 loc) · 957 Bytes
/
install.sh
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
#!/bin/bash
# Automatically calibrate Voron TAP's probe offset
#
# Copyright (C) 2023 Anonoei <[email protected]>
#
# This file may be distributed under the terms of the MIT license.
# Force script to exit if an error occurs
set -e
KLIPPER_PATH="${HOME}/klipper"
SYSTEMDDIR="/etc/systemd/system"
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/ && pwd )"
# Verify we're running as root
if [ "$(id -u)" -eq 0 ]; then
echo "This script must not run as root"
exit -1
fi
# Check if Klipper is installed
if [ "$(sudo systemctl list-units --full -all -t service --no-legend | grep -F "klipper.service")" ]; then
echo "Klipper service found!"
else
echo "Klipper service not found, please install Klipper first"
exit -1
fi
# Link auto_tap to klipper
echo "Linking auto tap to Klipper..."
ln -sf "${SRCDIR}/auto_tap.py" "${KLIPPER_PATH}/klippy/extras/auto_tap.py"
# Restart klipper
echo "Restarting Klipper..."
sudo systemctl restart klipper