logging: log which function is reading .kiauh.ini
Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
@@ -23,7 +23,7 @@ function check_for_backup_dir(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function backup_before_update(){
|
function backup_before_update(){
|
||||||
read_kiauh_ini
|
read_kiauh_ini "${FUNCNAME[0]}"
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
local state="${backup_before_update}"
|
local state="${backup_before_update}"
|
||||||
[ "${state}" = "false" ] && return
|
[ "${state}" = "false" ] && return
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ function get_fluidd_download_url() {
|
|||||||
stable_tag=$(echo "${tags}" | grep -E "^v([0-9]+\.?){3}$" | head -1)
|
stable_tag=$(echo "${tags}" | grep -E "^v([0-9]+\.?){3}$" | head -1)
|
||||||
stable_url="https://github.com/fluidd-core/fluidd/releases/download/${stable_tag}/fluidd.zip"
|
stable_url="https://github.com/fluidd-core/fluidd/releases/download/${stable_tag}/fluidd.zip"
|
||||||
|
|
||||||
read_kiauh_ini
|
read_kiauh_ini "${FUNCNAME[0]}"
|
||||||
if [ "${fluidd_install_unstable}" == "true" ]; then
|
if [ "${fluidd_install_unstable}" == "true" ]; then
|
||||||
url="${latest_url}"
|
url="${latest_url}"
|
||||||
echo "${url}"
|
echo "${url}"
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ function create_klipper_virtualenv(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function klipper_setup(){
|
function klipper_setup(){
|
||||||
read_kiauh_ini
|
read_kiauh_ini "${FUNCNAME[0]}"
|
||||||
local custom_repo="${custom_klipper_repo}"
|
local custom_repo="${custom_klipper_repo}"
|
||||||
local custom_branch="${custom_klipper_repo_branch}"
|
local custom_branch="${custom_klipper_repo_branch}"
|
||||||
local instances=${1} python_version=${2}
|
local instances=${1} python_version=${2}
|
||||||
@@ -427,7 +427,7 @@ function compare_klipper_versions(){
|
|||||||
|
|
||||||
function get_klipper_cfg_dir() {
|
function get_klipper_cfg_dir() {
|
||||||
local cfg_dir
|
local cfg_dir
|
||||||
read_kiauh_ini
|
read_kiauh_ini "${FUNCNAME[0]}"
|
||||||
if [ -z "${custom_klipper_cfg_loc}" ]; then
|
if [ -z "${custom_klipper_cfg_loc}" ]; then
|
||||||
cfg_dir="${HOME}/klipper_config"
|
cfg_dir="${HOME}/klipper_config"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ function get_mainsail_download_url() {
|
|||||||
stable_tag=$(echo "${tags}" | grep -E "^v([0-9]+\.?){3}$" | head -1)
|
stable_tag=$(echo "${tags}" | grep -E "^v([0-9]+\.?){3}$" | head -1)
|
||||||
stable_url="https://github.com/mainsail-crew/mainsail/releases/download/${stable_tag}/mainsail.zip"
|
stable_url="https://github.com/mainsail-crew/mainsail/releases/download/${stable_tag}/mainsail.zip"
|
||||||
|
|
||||||
read_kiauh_ini
|
read_kiauh_ini "${FUNCNAME[0]}"
|
||||||
if [ "${mainsail_install_unstable}" == "true" ]; then
|
if [ "${mainsail_install_unstable}" == "true" ]; then
|
||||||
url="${latest_url}"
|
url="${latest_url}"
|
||||||
echo "${url}"
|
echo "${url}"
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ function symlink_webui_nginx_log(){
|
|||||||
function match_nginx_configs(){
|
function match_nginx_configs(){
|
||||||
local cfg_updated="false"
|
local cfg_updated="false"
|
||||||
### reinstall nginx configs if the amount of upstreams don't match anymore
|
### reinstall nginx configs if the amount of upstreams don't match anymore
|
||||||
read_kiauh_ini
|
read_kiauh_ini "${FUNCNAME[0]}"
|
||||||
mainsail_nginx_cfg="/etc/nginx/sites-available/mainsail"
|
mainsail_nginx_cfg="/etc/nginx/sites-available/mainsail"
|
||||||
fluidd_nginx_cfg="/etc/nginx/sites-available/fluidd"
|
fluidd_nginx_cfg="/etc/nginx/sites-available/fluidd"
|
||||||
upstreams_webcams=$(grep -E "mjpgstreamer" /etc/nginx/conf.d/upstreams.conf | wc -l)
|
upstreams_webcams=$(grep -E "mjpgstreamer" /etc/nginx/conf.d/upstreams.conf | wc -l)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
function settings_ui() {
|
function settings_ui() {
|
||||||
read_kiauh_ini
|
read_kiauh_ini "${FUNCNAME[0]}"
|
||||||
local custom_cfg_loc="${custom_klipper_cfg_loc}"
|
local custom_cfg_loc="${custom_klipper_cfg_loc}"
|
||||||
local custom_repo="${custom_klipper_repo}"
|
local custom_repo="${custom_klipper_repo}"
|
||||||
local custom_branch="${custom_klipper_repo_branch}"
|
local custom_branch="${custom_klipper_repo_branch}"
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ function accept_upload_conditions(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function upload_selection(){
|
function upload_selection(){
|
||||||
read_kiauh_ini
|
read_kiauh_ini "${FUNCNAME[0]}"
|
||||||
local upload_agreed="${logupload_accepted}"
|
local upload_agreed="${logupload_accepted}"
|
||||||
[ "${upload_agreed}" = "false" ] && accept_upload_conditions
|
[ "${upload_agreed}" = "false" ] && accept_upload_conditions
|
||||||
|
|
||||||
|
|||||||
@@ -99,12 +99,13 @@ function log_error() {
|
|||||||
#================================================#
|
#================================================#
|
||||||
|
|
||||||
function read_kiauh_ini(){
|
function read_kiauh_ini(){
|
||||||
|
local func=${1}
|
||||||
if [ ! -f "${INI_FILE}" ]; then
|
if [ ! -f "${INI_FILE}" ]; then
|
||||||
print_error "ERROR: File '~/.kiauh.ini' not found!"
|
print_error "ERROR: File '~/.kiauh.ini' not found!"
|
||||||
log_error "Reading from .kiauh.ini failed! File not found!"
|
log_error "Reading from .kiauh.ini failed! File not found!"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
log_info "Reading from .kiauh.ini"
|
log_info "${func}: reading from .kiauh.ini"
|
||||||
source "${INI_FILE}"
|
source "${INI_FILE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,7 +288,7 @@ function set_klipper_cfg_path(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function switch_mainsail_releasetype() {
|
function switch_mainsail_releasetype() {
|
||||||
read_kiauh_ini
|
read_kiauh_ini "${FUNCNAME[0]}"
|
||||||
local state="${mainsail_install_unstable}"
|
local state="${mainsail_install_unstable}"
|
||||||
if [ "${state}" == "false" ]; then
|
if [ "${state}" == "false" ]; then
|
||||||
sed -i '/mainsail_install_unstable=/s/false/true/' "${INI_FILE}"
|
sed -i '/mainsail_install_unstable=/s/false/true/' "${INI_FILE}"
|
||||||
@@ -299,7 +300,7 @@ function switch_mainsail_releasetype() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function switch_fluidd_releasetype() {
|
function switch_fluidd_releasetype() {
|
||||||
read_kiauh_ini
|
read_kiauh_ini "${FUNCNAME[0]}"
|
||||||
local state="${fluidd_install_unstable}"
|
local state="${fluidd_install_unstable}"
|
||||||
if [ "${state}" == "false" ]; then
|
if [ "${state}" == "false" ]; then
|
||||||
sed -i '/fluidd_install_unstable=/s/false/true/' "${INI_FILE}"
|
sed -i '/fluidd_install_unstable=/s/false/true/' "${INI_FILE}"
|
||||||
@@ -311,7 +312,7 @@ function switch_fluidd_releasetype() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toggle_backup_before_update(){
|
function toggle_backup_before_update(){
|
||||||
read_kiauh_ini
|
read_kiauh_ini "${FUNCNAME[0]}"
|
||||||
local state="${backup_before_update}"
|
local state="${backup_before_update}"
|
||||||
if [ "${state}" = "false" ]; then
|
if [ "${state}" = "false" ]; then
|
||||||
sed -i '/backup_before_update=/s/false/true/' "${INI_FILE}"
|
sed -i '/backup_before_update=/s/false/true/' "${INI_FILE}"
|
||||||
@@ -321,7 +322,7 @@ function toggle_backup_before_update(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function set_custom_klipper_repo() {
|
function set_custom_klipper_repo() {
|
||||||
read_kiauh_ini
|
read_kiauh_ini "${FUNCNAME[0]}"
|
||||||
local repo_url=${1} branch=${2}
|
local repo_url=${1} branch=${2}
|
||||||
sed -i "/^custom_klipper_repo=/d" "${INI_FILE}"
|
sed -i "/^custom_klipper_repo=/d" "${INI_FILE}"
|
||||||
sed -i '$a'"custom_klipper_repo=${repo_url}" "${INI_FILE}"
|
sed -i '$a'"custom_klipper_repo=${repo_url}" "${INI_FILE}"
|
||||||
|
|||||||
Reference in New Issue
Block a user