feat: KIAUH v4.0.0 #191

Merged
dw-0 merged 453 commits from v4-rc into master 2022-05-29 20:11:16 +02:00
8 changed files with 34 additions and 34 deletions
Showing only changes of commit be570ee8de - Show all commits

View File

@@ -23,34 +23,11 @@ function check_for_backup_dir(){
fi fi
} }
function toggle_backups(){ function backup_before_update(){
read_kiauh_ini read_kiauh_ini
if [ "${backup_before_update}" = "true" ]; then local state="${backup_before_update}"
sed -i '/backup_before_update=/s/true/false/' "${INI_FILE}" [ "${state}" = "false" ] && return
BB4U_STATUS="${green}[Enable]${white} backups before updating " backup_"${1}"
CONFIRM_MSG=" Backups before updates are now >>> DISABLED <<< !"
fi
if [ "${backup_before_update}" = "false" ]; then
sed -i '/backup_before_update=/s/false/true/' "${INI_FILE}"
BB4U_STATUS="${red}[Disable]${white} backups before updating "
CONFIRM_MSG=" Backups before updates are now >>> ENABLED <<< !"
fi
}
function bb4u(){
read_kiauh_ini
if [ "${backup_before_update}" = "true" ]; then
backup_"${1}"
fi
}
function read_bb4u_stat(){
read_kiauh_ini
if [ ! "${backup_before_update}" = "true" ]; then
BB4U_STATUS="${green}[Enable]${white} backups before updating "
else
BB4U_STATUS="${red}[Disable]${white} backups before updating "
fi
} }
function backup_printer_cfg(){ function backup_printer_cfg(){

View File

@@ -233,7 +233,7 @@ function remove_fluidd(){
#===================================================# #===================================================#
function update_fluidd(){ function update_fluidd(){
bb4u "fluidd" backup_before_update "fluidd"
status_msg "Updating Fluidd ..." status_msg "Updating Fluidd ..."
fluidd_setup fluidd_setup
match_nginx_configs match_nginx_configs

View File

@@ -341,7 +341,7 @@ function update_klipper(){
if [ ! -d "${KLIPPER_DIR}" ]; then if [ ! -d "${KLIPPER_DIR}" ]; then
cd "${HOME}" && git clone "${KLIPPER_REPO}" cd "${HOME}" && git clone "${KLIPPER_REPO}"
else else
bb4u "klipper" backup_before_update "klipper"
status_msg "Updating Klipper ..." status_msg "Updating Klipper ..."
cd "${KLIPPER_DIR}" && git pull cd "${KLIPPER_DIR}" && git pull
### read PKGLIST and install possible new dependencies ### read PKGLIST and install possible new dependencies

View File

@@ -238,7 +238,7 @@ function remove_mainsail(){
#===================================================# #===================================================#
function update_mainsail(){ function update_mainsail(){
bb4u "mainsail" backup_before_update "mainsail"
status_msg "Updating Mainsail ..." status_msg "Updating Mainsail ..."
mainsail_setup mainsail_setup
match_nginx_configs match_nginx_configs

View File

@@ -395,7 +395,7 @@ function update_moonraker(){
if [ ! -d "${MOONRAKER_DIR}" ]; then if [ ! -d "${MOONRAKER_DIR}" ]; then
cd "${HOME}" && git clone "${MOONRAKER_REPO}" cd "${HOME}" && git clone "${MOONRAKER_REPO}"
else else
bb4u "moonraker" backup_before_update "moonraker"
status_msg "Updating Moonraker ..." status_msg "Updating Moonraker ..."
cd "${MOONRAKER_DIR}" && git pull cd "${MOONRAKER_DIR}" && git pull
### read PKGLIST and install possible new dependencies ### read PKGLIST and install possible new dependencies

View File

@@ -18,6 +18,7 @@ function settings_ui() {
local custom_branch="${custom_klipper_repo_branch}" local custom_branch="${custom_klipper_repo_branch}"
local ms_pre_rls="${mainsail_install_unstable}" local ms_pre_rls="${mainsail_install_unstable}"
local fl_pre_rls="${fluidd_install_unstable}" local fl_pre_rls="${fluidd_install_unstable}"
local bbu="${backup_before_update}"
### config location ### config location
if [ -z "${custom_cfg_loc}" ]; then if [ -z "${custom_cfg_loc}" ]; then
@@ -49,6 +50,12 @@ function settings_ui() {
else else
fl_pre_rls="${green}${fl_pre_rls}${white}" fl_pre_rls="${green}${fl_pre_rls}${white}"
fi fi
### backup before update toggle
if [ "${bbu}" == "false" ]; then
bbu="${red}${bbu}${white}"
else
bbu="${green}${bbu}${white}"
fi
top_border top_border
echo -e "| $(title_msg "~~~~~~~~~~~~ [ KIAUH Settings ] ~~~~~~~~~~~~~") |" echo -e "| $(title_msg "~~~~~~~~~~~~ [ KIAUH Settings ] ~~~~~~~~~~~~~") |"
@@ -63,6 +70,8 @@ function settings_ui() {
printf "| Mainsail: %-55s|\n" "${ms_pre_rls}" printf "| Mainsail: %-55s|\n" "${ms_pre_rls}"
printf "| Fluidd: %-55s|\n" "${fl_pre_rls}" printf "| Fluidd: %-55s|\n" "${fl_pre_rls}"
hr hr
printf "| Backup before updating: %-42s|\n" "${bbu}"
hr
echo -e "| 1) Change Klipper config folder location |" echo -e "| 1) Change Klipper config folder location |"
echo -e "| 2) Set custom Klipper repository |" echo -e "| 2) Set custom Klipper repository |"
if [ "${mainsail_install_unstable}" == "false" ]; then if [ "${mainsail_install_unstable}" == "false" ]; then
@@ -75,6 +84,11 @@ function settings_ui() {
else else
echo -e "| 4) ${red}Disallow${white} unstable Fluidd releases |" echo -e "| 4) ${red}Disallow${white} unstable Fluidd releases |"
fi fi
if [ "${backup_before_update}" == "false" ]; then
echo -e "| 5) ${green}Enable${white} automatic backups before updates |"
else
echo -e "| 5) ${red}Disable${white} automatic backups before updates |"
fi
back_help_footer back_help_footer
} }
@@ -133,6 +147,8 @@ function settings_menu(){
switch_mainsail_releasetype && settings_menu;; switch_mainsail_releasetype && settings_menu;;
4) 4)
switch_fluidd_releasetype && settings_menu;; switch_fluidd_releasetype && settings_menu;;
5)
toggle_backup_before_update && settings_menu;;
B|b) B|b)
clear clear
main_menu main_menu

View File

@@ -15,8 +15,6 @@ function update_ui(){
top_border top_border
echo -e "| ${green}~~~~~~~~~~~~~~ [ Update Menu ] ~~~~~~~~~~~~~~${white} | " echo -e "| ${green}~~~~~~~~~~~~~~ [ Update Menu ] ~~~~~~~~~~~~~~${white} | "
hr hr
echo -e "| 0) ${BB4U_STATUS}| "
hr
echo -e "| a) [Update all] | | | " echo -e "| a) [Update all] | | | "
echo -e "| | Installed: | Latest: | " echo -e "| | Installed: | Latest: | "
echo -e "| Klipper & API: |---------------|--------------| " echo -e "| Klipper & API: |---------------|--------------| "
@@ -40,7 +38,6 @@ function update_ui(){
function update_menu(){ function update_menu(){
unset update_arr unset update_arr
read_bb4u_stat
do_action "" "update_ui" do_action "" "update_ui"
while true; do while true; do
read -p "${cyan}####### Perform action:${white} " action read -p "${cyan}####### Perform action:${white} " action

View File

@@ -310,6 +310,16 @@ function switch_fluidd_releasetype() {
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.
fi fi
} }
function toggle_backup_before_update(){
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.
read_kiauh_ini
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.
local state="${backup_before_update}"
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.
if [ "${state}" = "false" ]; then
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.
sed -i '/backup_before_update=/s/false/true/' "${INI_FILE}"
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.
else
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.
sed -i '/backup_before_update=/s/true/false/' "${INI_FILE}"
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.
fi
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.
}
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.
function set_custom_klipper_repo() { function set_custom_klipper_repo() {
read_kiauh_ini read_kiauh_ini
local repo_url=${1} branch=${2} local repo_url=${1} branch=${2}
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:21:48 +02:00 (Migrated from github.com)
Review
    sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak"
```suggestion sudo cp "/etc/hosts" "/etc/hosts.${current_date}.bak" ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
clee commented 2022-05-04 07:23:45 +02:00 (Migrated from github.com)
Review

I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk.

###### Creating backup of hosts file ...
cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak'
Try 'cp --help' for more information.
I had to make this change in order to fix the error I got when I attempted to change the hostname (4/advanced, 7/change hostname from the menus) on armbian-22.05-trunk. ``` ###### Creating backup of hosts file ... cp: missing destination file operand after '/etc/hosts /etc/hosts.220503-2314.bak' Try 'cp --help' for more information. ```
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.
dw-0 commented 2022-05-05 10:14:01 +02:00 (Migrated from github.com)
Review

Thank you! Yes that was indeed a typo and i just fixed it.

Thank you! Yes that was indeed a typo and i just fixed it.