-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathinstall-afc.sh
executable file
·61 lines (52 loc) · 1.37 KB
/
install-afc.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
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
#!/usr/bin/env bash
# Armored Turtle Automated Filament Changer
#
# Copyright (C) 2024 Armored Turtle
#
# This file may be distributed under the terms of the GNU GPLv3 license.
set -e
export LC_ALL=C
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Menu functions
source include/menus/main_menu.sh
source include/menus/install_menu.sh
source include/menus/update_menu.sh
# Install / Update functions
source include/buffer_configurations.sh
source include/check_commands.sh
source include/colors.sh
source include/constants.sh
source include/install_functions.sh
source include/uninstall.sh
source include/update_commands.sh
source include/update_functions.sh
source include/utils.sh
###################### Main script logic below ######################
while getopts "k:s:m:b:p:u:th" arg; do
case ${arg} in
k) klipper_dir=${OPTARG} ;;
m) moonraker_config_file=${OPTARG} ;;
s) klipper_service=${OPTARG} ;;
b) branch=${OPTARG} ;;
p) printer_config_dir=${OPTARG} ;;
t) test_mode=True ;;
h) show_help
exit 0 ;;
*) exit 1 ;;
esac
done
clear
# Make sure necessary directories exist
check_root
check_for_hh
check_for_prereqs
if [ "$test_mode" == "False" ]; then
clone_repo
fi
check_existing_install
check_version_and_set_force_update
#set_install_version_if_missing
if [ "$force_update_no_version" == "False" ]; then
check_version_and_set_force_update
fi
main_menu