feat: outsource globals in own file
Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
1
kiauh.sh
1
kiauh.sh
@@ -78,6 +78,7 @@ function kiauh_update_avail(){
|
||||
#}
|
||||
|
||||
check_euid
|
||||
set_globals
|
||||
init_ini
|
||||
kiauh_update_avail
|
||||
main_menu
|
||||
|
||||
@@ -11,10 +11,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
### global variables
|
||||
BACKUP_DIR="${HOME}/kiauh-backups"
|
||||
KLIPPER_CONFIG="$(get_klipper_cfg_dir)"
|
||||
|
||||
function get_date(){
|
||||
current_date=$(date +"%y%m%d-%H%M")
|
||||
echo "${current_date}"
|
||||
|
||||
@@ -11,11 +11,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
### global variables
|
||||
FLUIDD_DIR="${HOME}/fluidd"
|
||||
FLUIDD_REPO_API="https://api.github.com/repos/fluidd-core/fluidd/releases"
|
||||
KLIPPER_CONFIG="$(get_klipper_cfg_dir)"
|
||||
|
||||
#===================================================#
|
||||
#================== INSTALL FLUIDD =================#
|
||||
#===================================================#
|
||||
|
||||
68
scripts/globals.sh
Normal file
68
scripts/globals.sh
Normal file
@@ -0,0 +1,68 @@
|
||||
#!/bin/bash
|
||||
|
||||
#=======================================================================#
|
||||
# Copyright (C) 2020 - 2022 Dominik Willner <th33xitus@gmail.com> #
|
||||
# #
|
||||
# This file is part of KIAUH - Klipper Installation And Update Helper #
|
||||
# https://github.com/th33xitus/kiauh #
|
||||
# #
|
||||
# This file may be distributed under the terms of the GNU GPLv3 license #
|
||||
#=======================================================================#
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
|
||||
function set_globals(){
|
||||
#=================== SYSTEM ===================#
|
||||
SYSTEMD="/etc/systemd/system"
|
||||
INITD="/etc/init.d"
|
||||
ETCDEF="/etc/default"
|
||||
|
||||
#=================== KIAUH ====================#
|
||||
green=$(echo -en "\e[92m")
|
||||
yellow=$(echo -en "\e[93m")
|
||||
red=$(echo -en "\e[91m")
|
||||
cyan=$(echo -en "\e[96m")
|
||||
white=$(echo -en "\e[39m")
|
||||
INI_FILE="${HOME}/.kiauh.ini"
|
||||
LOGFILE="/tmp/kiauh.log"
|
||||
BACKUP_DIR="${HOME}/kiauh-backups"
|
||||
|
||||
#================== KLIPPER ===================#
|
||||
KLIPPY_ENV="${HOME}/klippy-env"
|
||||
KLIPPER_DIR="${HOME}/klipper"
|
||||
KLIPPER_REPO="https://github.com/Klipper3d/klipper.git"
|
||||
KLIPPER_CONFIG="$(get_klipper_cfg_dir)"
|
||||
|
||||
#================= MOONRAKER ==================#
|
||||
MOONRAKER_ENV="${HOME}/moonraker-env"
|
||||
MOONRAKER_DIR="${HOME}/moonraker"
|
||||
MOONRAKER_REPO="https://github.com/Arksine/moonraker.git"
|
||||
|
||||
#================= MAINSAIL ===================#
|
||||
MAINSAIL_DIR="${HOME}/mainsail"
|
||||
MAINSAIL_REPO_API="https://api.github.com/repos/mainsail-crew/mainsail/releases"
|
||||
MAINSAIL_TAGS="https://api.github.com/repos/mainsail-crew/mainsail/tags"
|
||||
|
||||
#================== FLUIDD ====================#
|
||||
FLUIDD_DIR="${HOME}/fluidd"
|
||||
FLUIDD_REPO_API="https://api.github.com/repos/fluidd-core/fluidd/releases"
|
||||
|
||||
#=============== KLIPPERSCREEN ================#
|
||||
KLIPPERSCREEN_ENV_DIR="${HOME}/.KlipperScreen-env"
|
||||
KLIPPERSCREEN_DIR="${HOME}/KlipperScreen"
|
||||
KLIPPERSCREEN_REPO=https://github.com/jordanruthe/KlipperScreen.git
|
||||
|
||||
#================ OCTOPRINT ===================#
|
||||
OCTOPRINT_ENV="${HOME}/OctoPrint"
|
||||
|
||||
#========== MOONRAKER-TELEGRAM-BOT ============#
|
||||
MOONRAKER_TELEGRAM_BOT_ENV_DIR=${HOME}/moonraker-telegram-bot-env
|
||||
MOONRAKER_TELEGRAM_BOT_DIR=${HOME}/moonraker-telegram-bot
|
||||
NLEF_REPO=https://github.com/nlef/moonraker-telegram-bot.git
|
||||
|
||||
#=============== PRETTY-GCODE =================#
|
||||
PGC_FOR_KLIPPER_REPO="https://github.com/Kragrathea/pgcode"
|
||||
PGC_DIR="${HOME}/pgcode"
|
||||
}
|
||||
@@ -11,15 +11,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
### global variables
|
||||
SYSTEMD="/etc/systemd/system"
|
||||
INITD="/etc/init.d"
|
||||
ETCDEF="/etc/default"
|
||||
KLIPPY_ENV="${HOME}/klippy-env"
|
||||
KLIPPER_DIR="${HOME}/klipper"
|
||||
KLIPPER_REPO="https://github.com/Klipper3d/klipper.git"
|
||||
KLIPPER_CONFIG="$(get_klipper_cfg_dir)"
|
||||
|
||||
#=================================================#
|
||||
#================ INSTALL KLIPPER ================#
|
||||
#=================================================#
|
||||
|
||||
@@ -11,13 +11,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
### global variables
|
||||
SYSTEMD="/etc/systemd/system"
|
||||
KLIPPERSCREEN_ENV_DIR="${HOME}/.KlipperScreen-env"
|
||||
KLIPPERSCREEN_DIR="${HOME}/KlipperScreen"
|
||||
KLIPPERSCREEN_REPO=https://github.com/jordanruthe/KlipperScreen.git
|
||||
KLIPPER_CONFIG="$(get_klipper_cfg_dir)"
|
||||
|
||||
#===================================================#
|
||||
#============== INSTALL KLIPPERSCREEN ==============#
|
||||
#===================================================#
|
||||
|
||||
@@ -11,12 +11,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
### global variables
|
||||
MAINSAIL_DIR="${HOME}/mainsail"
|
||||
MAINSAIL_REPO_API="https://api.github.com/repos/mainsail-crew/mainsail/releases"
|
||||
MAINSAIL_TAGS="https://api.github.com/repos/mainsail-crew/mainsail/tags"
|
||||
KLIPPER_CONFIG="$(get_klipper_cfg_dir)"
|
||||
|
||||
#===================================================#
|
||||
#================= INSTALL MAINSAIL ================#
|
||||
#===================================================#
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
### base variables
|
||||
SYSTEMD="/etc/systemd/system"
|
||||
WEBCAMD_SRC="https://raw.githubusercontent.com/mainsail-crew/MainsailOS/master/src/modules/mjpgstreamer/filesystem/root/usr/local/bin/webcamd"
|
||||
WEBCAM_TXT_SRC="https://raw.githubusercontent.com/mainsail-crew/MainsailOS/master/src/modules/mjpgstreamer/filesystem/home/pi/klipper_config/webcam.txt"
|
||||
|
||||
|
||||
@@ -11,13 +11,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
### global variables
|
||||
SYSTEMD="/etc/systemd/system"
|
||||
MOONRAKER_TELEGRAM_BOT_ENV_DIR=${HOME}/moonraker-telegram-bot-env
|
||||
MOONRAKER_TELEGRAM_BOT_DIR=${HOME}/moonraker-telegram-bot
|
||||
NLEF_REPO=https://github.com/nlef/moonraker-telegram-bot.git
|
||||
KLIPPER_CONFIG="$(get_klipper_cfg_dir)"
|
||||
|
||||
#===================================================#
|
||||
#=========== REMOVE MOONRAKERTELEGRAMBOT ===========#
|
||||
#===================================================#
|
||||
|
||||
@@ -11,14 +11,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
### global variables
|
||||
SYSTEMD="/etc/systemd/system"
|
||||
INITD="/etc/init.d"
|
||||
ETCDEF="/etc/default"
|
||||
MOONRAKER_ENV="${HOME}/moonraker-env"
|
||||
MOONRAKER_DIR="${HOME}/moonraker"
|
||||
MOONRAKER_REPO="https://github.com/Arksine/moonraker.git"
|
||||
|
||||
#===================================================#
|
||||
#================ INSTALL MOONRAKER ================#
|
||||
#===================================================#
|
||||
|
||||
@@ -11,10 +11,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
### global variables
|
||||
SYSTEMD="/etc/systemd/system"
|
||||
OCTOPRINT_ENV="${HOME}/OctoPrint"
|
||||
|
||||
#=================================================#
|
||||
#=============== INSTALL OCTOPRINT ===============#
|
||||
#=================================================#
|
||||
|
||||
@@ -11,10 +11,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
### base variables
|
||||
PGC_FOR_KLIPPER_REPO="https://github.com/Kragrathea/pgcode"
|
||||
PGC_DIR="${HOME}/pgcode"
|
||||
|
||||
#=================================================#
|
||||
#================== INSTALL PGC ==================#
|
||||
#=================================================#
|
||||
|
||||
@@ -11,11 +11,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
### global variables
|
||||
SYSTEMD="/etc/systemd/system"
|
||||
INI_FILE="${HOME}/.kiauh.ini"
|
||||
LOGFILE="/tmp/kiauh.log"
|
||||
|
||||
#================================================#
|
||||
#=================== STARTUP ====================#
|
||||
#================================================#
|
||||
@@ -35,11 +30,6 @@ function check_euid(){
|
||||
#================================================#
|
||||
#============= MESSAGE FORMATTING ===============#
|
||||
#================================================#
|
||||
green=$(echo -en "\e[92m")
|
||||
yellow=$(echo -en "\e[93m")
|
||||
red=$(echo -en "\e[91m")
|
||||
cyan=$(echo -en "\e[96m")
|
||||
white=$(echo -en "\e[39m")
|
||||
|
||||
function select_msg() {
|
||||
echo -e "${white}>>>>>> $1"
|
||||
|
||||
Reference in New Issue
Block a user