From 600036059f1dfe7eb5605157acd68aba3d06fb90 Mon Sep 17 00:00:00 2001 From: Yifei Ding Date: Fri, 12 Nov 2021 15:20:39 -0800 Subject: [PATCH] script: remove redundant systemd constant --- scripts/constants/constants.sh | 66 +++++++++---------- .../install-debian.sh | 1 - scripts/install_dwc2.sh | 1 - scripts/install_klipper.sh | 1 - scripts/install_mjpg-streamer.sh | 1 - scripts/install_moonraker.sh | 1 - scripts/install_octoprint.sh | 1 - scripts/ms_theme_installer.sh | 1 - scripts/remove.sh | 3 - 9 files changed, 32 insertions(+), 44 deletions(-) diff --git a/scripts/constants/constants.sh b/scripts/constants/constants.sh index b491a28..74cc45e 100755 --- a/scripts/constants/constants.sh +++ b/scripts/constants/constants.sh @@ -1,52 +1,50 @@ +#!/bin/bash ### set important directories #kiauh.sh #klipper -KLIPPER_DIR=${HOME}/klipper -KLIPPY_ENV=${HOME}/klippy-env +readonly KLIPPER_DIR=${HOME}/klipper +readonly KLIPPY_ENV=${HOME}/klippy-env #nginx -NGINX_SA=/etc/nginx/sites-available -NGINX_SE=/etc/nginx/sites-enabled -NGINX_CONFD=/etc/nginx/conf.d +readonly NGINX_SA=/etc/nginx/sites-available +readonly NGINX_SE=/etc/nginx/sites-enabled +readonly NGINX_CONFD=/etc/nginx/conf.d #moonraker -MOONRAKER_DIR=${HOME}/moonraker -MOONRAKER_ENV=${HOME}/moonraker-env +readonly MOONRAKER_DIR=${HOME}/moonraker +readonly MOONRAKER_ENV=${HOME}/moonraker-env #mainsail -MAINSAIL_DIR=${HOME}/mainsail +readonly MAINSAIL_DIR=${HOME}/mainsail #fluidd -FLUIDD_DIR=${HOME}/fluidd +readonly FLUIDD_DIR=${HOME}/fluidd #dwc2 -DWC2FK_DIR=${HOME}/dwc2-for-klipper-socket -DWC_ENV_DIR=${HOME}/dwc-env -DWC2_DIR=${HOME}/duetwebcontrol +readonly DWC2FK_DIR=${HOME}/dwc2-for-klipper-socket +readonly DWC_ENV_DIR=${HOME}/dwc-env +readonly DWC2_DIR=${HOME}/duetwebcontrol #octoprint -OCTOPRINT_DIR=${HOME}/OctoPrint +readonly OCTOPRINT_DIR=${HOME}/OctoPrint #KlipperScreen -KLIPPERSCREEN_DIR=${HOME}/KlipperScreen -KLIPPERSCREEN_ENV_DIR=${HOME}/.KlipperScreen-env +readonly KLIPPERSCREEN_DIR=${HOME}/KlipperScreen +readonly KLIPPERSCREEN_ENV_DIR=${HOME}/.KlipperScreen-env #MoonrakerTelegramBot -MOONRAKER_TELEGRAM_BOT_DIR=${HOME}/moonraker-telegram-bot -MOONRAKER_TELEGRAM_BOT_ENV_DIR=${HOME}/moonraker-telegram-bot-env +readonly MOONRAKER_TELEGRAM_BOT_DIR=${HOME}/moonraker-telegram-bot +readonly MOONRAKER_TELEGRAM_BOT_ENV_DIR=${HOME}/moonraker-telegram-bot-env #misc -INI_FILE=${HOME}/.kiauh.ini -BACKUP_DIR=${HOME}/kiauh-backups +readonly INI_FILE=${HOME}/.kiauh.ini +readonly BACKUP_DIR=${HOME}/kiauh-backups +readonly SYSTEMDDIR=/etc/systemd/system ### set github repos -KLIPPER_REPO=https://github.com/Klipper3d/klipper.git -ARKSINE_REPO=https://github.com/Arksine/klipper.git -DMBUTYUGIN_REPO=https://github.com/dmbutyugin/klipper.git -DWC2FK_REPO=https://github.com/Stephan3/dwc2-for-klipper-socket.git -KLIPPERSCREEN_REPO=https://github.com/jordanruthe/KlipperScreen.git -NLEF_REPO=https://github.com/nlef/moonraker-telegram-bot.git +readonly KLIPPER_REPO=https://github.com/Klipper3d/klipper.git +readonly ARKSINE_REPO=https://github.com/Arksine/klipper.git +readonly DMBUTYUGIN_REPO=https://github.com/dmbutyugin/klipper.git +readonly DWC2FK_REPO=https://github.com/Stephan3/dwc2-for-klipper-socket.git +readonly KLIPPERSCREEN_REPO=https://github.com/jordanruthe/KlipperScreen.git +readonly NLEF_REPO=https://github.com/nlef/moonraker-telegram-bot.git #branches -BRANCH_SCURVE_SMOOTHING=dmbutyugin/scurve-smoothing -BRANCH_SCURVE_SHAPING=dmbutyugin/scurve-shaping +readonly BRANCH_SCURVE_SMOOTHING=dmbutyugin/scurve-smoothing +readonly BRANCH_SCURVE_SHAPING=dmbutyugin/scurve-shaping ###Whiptail -KIAUH_WHIPTAIL_WIDTH=96 -KIAUH_WHIPTAIL_HEIGHT=25 - -#functions.sh -### base variables -SYSTEMDDIR="/etc/systemd/system" - +readonly KIAUH_WHIPTAIL_NORMAL_WIDTH=70 +readonly KIAUH_WHIPTAIL_NORMAL_HEIGHT=24 +readonly KIAUH_WHIPTAIL_SINGLE_LINE_HEIGHT=7 diff --git a/scripts/dwc2-for-klipper-socket-installer/install-debian.sh b/scripts/dwc2-for-klipper-socket-installer/install-debian.sh index 8012c58..e71385e 100755 --- a/scripts/dwc2-for-klipper-socket-installer/install-debian.sh +++ b/scripts/dwc2-for-klipper-socket-installer/install-debian.sh @@ -5,7 +5,6 @@ # https://github.com/Stephan3/dwc2-for-klipper-socket.git PYTHONDIR="${HOME}/dwc-env" -SYSTEMDDIR="/etc/systemd/system" DWC_USER=${USER} # Step 1: Verify Klipper has been installed diff --git a/scripts/install_dwc2.sh b/scripts/install_dwc2.sh index f45de5c..65223ce 100755 --- a/scripts/install_dwc2.sh +++ b/scripts/install_dwc2.sh @@ -1,5 +1,4 @@ ### base variables -SYSTEMDDIR="/etc/systemd/system" DWC_ENV="${HOME}/dwc-env" DWC2_DIR="${HOME}/duetwebcontrol" diff --git a/scripts/install_klipper.sh b/scripts/install_klipper.sh index 6ee6dfe..664f6dd 100755 --- a/scripts/install_klipper.sh +++ b/scripts/install_klipper.sh @@ -1,5 +1,4 @@ ### base variables -SYSTEMDDIR="/etc/systemd/system" KLIPPY_ENV="${HOME}/klippy-env" KLIPPER_DIR="${HOME}/klipper" diff --git a/scripts/install_mjpg-streamer.sh b/scripts/install_mjpg-streamer.sh index 8035642..5390f9b 100755 --- a/scripts/install_mjpg-streamer.sh +++ b/scripts/install_mjpg-streamer.sh @@ -1,5 +1,4 @@ ### base variables -SYSTEMDDIR="/etc/systemd/system" WEBCAMD_SRC="https://raw.githubusercontent.com/raymondh2/MainsailOS/master/src/modules/mjpgstreamer/filesystem/root/usr/local/bin/webcamd" WEBCAM_TXT_SRC="https://raw.githubusercontent.com/raymondh2/MainsailOS/master/src/modules/mjpgstreamer/filesystem/home/pi/klipper_config/webcam.txt" diff --git a/scripts/install_moonraker.sh b/scripts/install_moonraker.sh index b6d2d75..a96c346 100755 --- a/scripts/install_moonraker.sh +++ b/scripts/install_moonraker.sh @@ -1,5 +1,4 @@ ### base variables -SYSTEMDDIR="/etc/systemd/system" MOONRAKER_ENV="${HOME}/moonraker-env" MOONRAKER_DIR="${HOME}/moonraker" MOONRAKER_REPO="https://github.com/Arksine/moonraker.git" diff --git a/scripts/install_octoprint.sh b/scripts/install_octoprint.sh index c48bf57..da89a47 100755 --- a/scripts/install_octoprint.sh +++ b/scripts/install_octoprint.sh @@ -1,5 +1,4 @@ ### base variables -SYSTEMDDIR="/etc/systemd/system" OCTOPRINT_ENV="${HOME}/OctoPrint" octoprint_setup_dialog(){ diff --git a/scripts/ms_theme_installer.sh b/scripts/ms_theme_installer.sh index 424de8e..2a61cb3 100755 --- a/scripts/ms_theme_installer.sh +++ b/scripts/ms_theme_installer.sh @@ -1,5 +1,4 @@ ### base variables -SYSTEMDDIR="/etc/systemd/system" get_theme_list(){ theme_csv_url="https://raw.githubusercontent.com/meteyou/mainsail/develop/docs/_data/themes.csv" diff --git a/scripts/remove.sh b/scripts/remove.sh index 29af7d0..1da6409 100755 --- a/scripts/remove.sh +++ b/scripts/remove.sh @@ -1,6 +1,3 @@ -### base variables -SYSTEMDDIR="/etc/systemd/system" - remove_klipper(){ shopt -s extglob # enable extended globbing ### ask the user if he wants to uninstall moonraker too.