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
4 changed files with 0 additions and 252 deletions
Showing only changes of commit 43021cbb83 - Show all commits

View File

@@ -1,23 +0,0 @@
install_MoonrakerTelegramBot(){
source_kiauh_ini
#MoonrakerTelegramBot main installation
MoonrakerTelegramBot_setup
#after install actions
restart_MoonrakerTelegramBot
}
MoonrakerTelegramBot_setup(){
source_kiauh_ini
export klipper_cfg_loc
dep=(virtualenv)
dependency_check
status_msg "Downloading MoonrakerTelegramBot ..."
#force remove existing MoonrakerTelegramBot dir
[ -d $MOONRAKER_TELEGRAM_BOT_DIR ] && rm -rf $MOONRAKER_TELEGRAM_BOT_DIR
#clone into fresh MoonrakerTelegramBot dir
cd ${HOME} && git clone $NLEF_REPO
ok_msg "Download complete!"
status_msg "Installing MoonrakerTelegramBot ..."
$MOONRAKER_TELEGRAM_BOT_DIR/scripts/install.sh
echo; ok_msg "MoonrakerTelegramBot successfully installed!"
}

View File

@@ -190,92 +190,6 @@ remove_nginx(){
fi
}
remove_klipperscreen(){
source_kiauh_ini
### remove KlipperScreen dir
if [ -d $KLIPPERSCREEN_DIR ]; then
status_msg "Removing KlipperScreen directory ..."
rm -rf $KLIPPERSCREEN_DIR && ok_msg "Directory removed!"
fi
### remove KlipperScreen VENV dir
if [ -d $KLIPPERSCREEN_ENV_DIR ]; then
status_msg "Removing KlipperScreen VENV directory ..."
rm -rf $KLIPPERSCREEN_ENV_DIR && ok_msg "Directory removed!"
fi
### remove KlipperScreen service
if [ -e /etc/systemd/system/KlipperScreen.service ]; then
status_msg "Removing KlipperScreen service ..."
sudo systemctl stop KlipperScreen
sudo systemctl disable KlipperScreen
sudo rm -f $SYSTEMDDIR/KlipperScreen.service
###reloading units
sudo systemctl daemon-reload
sudo systemctl reset-failed
ok_msg "KlipperScreen Service removed!"
fi
### remove KlipperScreen log
if [ -e /tmp/KlipperScreen.log ]; then
status_msg "Removing KlipperScreen log file ..."
rm -f /tmp/KlipperScreen.log && ok_msg "File removed!"
fi
### remove KlipperScreen log symlink in config dir
if [ -e $klipper_cfg_loc/KlipperScreen.log ]; then
status_msg "Removing KlipperScreen log symlink ..."
rm -f $klipper_cfg_loc/KlipperScreen.log && ok_msg "File removed!"
fi
CONFIRM_MSG="KlipperScreen successfully removed!"
}
remove_MoonrakerTelegramBot(){
source_kiauh_ini
### remove MoonrakerTelegramBot dir
if [ -d $MOONRAKER_TELEGRAM_BOT_DIR ]; then
status_msg "Removing MoonrakerTelegramBot directory ..."
rm -rf $MOONRAKER_TELEGRAM_BOT_DIR && ok_msg "Directory removed!"
fi
### remove MoonrakerTelegramBot VENV dir
if [ -d $MOONRAKER_TELEGRAM_BOT_ENV_DIR ]; then
status_msg "Removing MoonrakerTelegramBot VENV directory ..."
rm -rf $MOONRAKER_TELEGRAM_BOT_ENV_DIR && ok_msg "Directory removed!"
fi
### remove MoonrakerTelegramBot service
if [ -e /etc/systemd/system/moonraker-telegram-bot.service ]; then
status_msg "Removing MoonrakerTelegramBot service ..."
sudo systemctl stop moonraker-telegram-bot
sudo systemctl disable moonraker-telegram-bot
sudo rm -f $SYSTEMDDIR/moonraker-telegram-bot.service
###reloading units
sudo systemctl daemon-reload
sudo systemctl reset-failed
ok_msg "MoonrakerTelegramBot Service removed!"
fi
### remove MoonrakerTelegramBot log
if [ -e /tmp/telegram.log ] || [ -e ${HOME}/klipper_logs/telegram.log ]; then
status_msg "Removing MoonrakerTelegramBot log file ..."
rm -f "/tmp/telegram.log" "${HOME}/klipper_logs/telegram.log" && ok_msg "File removed!"
fi
### remove MoonrakerTelegramBot log symlink in config dir
if [ -e $klipper_cfg_loc/telegram.log ]; then
status_msg "Removing MoonrakerTelegramBot log symlink ..."
rm -f $klipper_cfg_loc/telegram.log && ok_msg "File removed!"
fi
CONFIRM_MSG="MoonrakerTelegramBot successfully removed!"
}
remove_mjpg-streamer(){
### remove MJPG-Streamer service
if [ -e $SYSTEMDDIR/webcamd.service ]; then

View File

@@ -130,66 +130,6 @@ octoprint_status(){
fi
}
klipperscreen_status(){
klsccount=0
klipperscreen_data=(
SERVICE
$KLIPPERSCREEN_DIR
$KLIPPERSCREEN_ENV_DIR
)
### count amount of klipperscreen_data service files in /etc/systemd/system
SERVICE_FILE_COUNT=$(ls /etc/systemd/system | grep -E "KlipperScreen" | wc -l)
### remove the "SERVICE" entry from the klipperscreen_data array if a KlipperScreen service is installed
[ $SERVICE_FILE_COUNT -gt 0 ] && unset klipperscreen_data[0]
#count+1 for each found data-item from array
for klscd in "${klipperscreen_data[@]}"
do
if [ -e $klscd ]; then
klsccount=$(expr $klsccount + 1)
fi
done
if [ "$klsccount" == "${#klipperscreen_data[*]}" ]; then
KLIPPERSCREEN_STATUS="${green}Installed!${default} "
elif [ "$klsccount" == 0 ]; then
KLIPPERSCREEN_STATUS="${red}Not installed!${default} "
else
KLIPPERSCREEN_STATUS="${yellow}Incomplete!${default} "
fi
}
MoonrakerTelegramBot_status(){
mtbcount=0
MoonrakerTelegramBot_data=(
SERVICE
$MOONRAKER_TELEGRAM_BOT_DIR
$MOONRAKER_TELEGRAM_BOT_ENV_DIR
)
### count amount of MoonrakerTelegramBot_data service files in /etc/systemd/system
SERVICE_FILE_COUNT=$(ls /etc/systemd/system | grep -E "moonraker-telegram-bot" | wc -l)
### remove the "SERVICE" entry from the MoonrakerTelegramBot_data array if a MoonrakerTelegramBot service is installed
[ $SERVICE_FILE_COUNT -gt 0 ] && unset MoonrakerTelegramBot_data[0]
#count+1 for each found data-item from array
for mtbd in "${MoonrakerTelegramBot_data[@]}"
do
if [ -e $mtbd ]; then
mtbcount=$(expr $mtbcount + 1)
fi
done
if [ "$mtbcount" == "${#MoonrakerTelegramBot_data[*]}" ]; then
MOONRAKER_TELEGRAM_BOT_STATUS="${green}Installed!${default} "
elif [ "$mtbcount" == 0 ]; then
MOONRAKER_TELEGRAM_BOT_STATUS="${red}Not installed!${default} "
else
MOONRAKER_TELEGRAM_BOT_STATUS="${yellow}Incomplete!${default} "
fi
}
#############################################################
#############################################################
@@ -340,61 +280,6 @@ compare_fluidd_versions(){
fi
}
read_klipperscreen_versions(){
if [ -d $KLIPPERSCREEN_DIR ] && [ -d $KLIPPERSCREEN_DIR/.git ]; then
cd $KLIPPERSCREEN_DIR
git fetch origin master -q
LOCAL_KLIPPERSCREEN_COMMIT=$(git describe HEAD --always --tags | cut -d "-" -f 1,2)
REMOTE_KLIPPERSCREEN_COMMIT=$(git describe origin/master --always --tags | cut -d "-" -f 1,2)
else
LOCAL_KLIPPERSCREEN_COMMIT=$NONE
REMOTE_KLIPPERSCREEN_COMMIT=$NONE
fi
}
compare_klipperscreen_versions(){
unset KLIPPERSCREEN_UPDATE_AVAIL
read_klipperscreen_versions
if [ "$LOCAL_KLIPPERSCREEN_COMMIT" != "$REMOTE_KLIPPERSCREEN_COMMIT" ]; then
LOCAL_KLIPPERSCREEN_COMMIT="${yellow}$(printf "%-12s" "$LOCAL_KLIPPERSCREEN_COMMIT")${default}"
REMOTE_KLIPPERSCREEN_COMMIT="${green}$(printf "%-12s" "$REMOTE_KLIPPERSCREEN_COMMIT")${default}"
KLIPPERSCREEN_UPDATE_AVAIL="true"
update_arr+=(update_klipperscreen)
else
LOCAL_KLIPPERSCREEN_COMMIT="${green}$(printf "%-12s" "$LOCAL_KLIPPERSCREEN_COMMIT")${default}"
REMOTE_KLIPPERSCREEN_COMMIT="${green}$(printf "%-12s" "$REMOTE_KLIPPERSCREEN_COMMIT")${default}"
KLIPPERSCREEN_UPDATE_AVAIL="false"
fi
}
read_MoonrakerTelegramBot_versions(){
if [ -d $MOONRAKER_TELEGRAM_BOT_DIR ] && [ -d $MOONRAKER_TELEGRAM_BOT_DIR/.git ]; then
cd $MOONRAKER_TELEGRAM_BOT_DIR
git fetch origin master -q
LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT=$(git describe HEAD --always --tags | cut -d "-" -f 1,2)
REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT=$(git describe origin/master --always --tags | cut -d "-" -f 1,2)
else
LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT=$NONE
REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT=$NONE
fi
}
compare_MoonrakerTelegramBot_versions(){
unset MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL
read_MoonrakerTelegramBot_versions
if [ "$LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT" != "$REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT" ]; then
LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT="${yellow}$(printf "%-12s" "$LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT")${default}"
REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT="${green}$(printf "%-12s" "$REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT")${default}"
# add moonraker telegram bot to the update all array for the update all function in the updater
MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL="true" && update_arr+=(update_MoonrakerTelegramBot)
else
LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT="${green}$(printf "%-12s" "$LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT")${default}"
REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT="${green}$(printf "%-12s" "$REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT")${default}"
MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL="false"
fi
}
#############################################################
#############################################################

View File

@@ -251,23 +251,6 @@ update_fluidd(){
symlink_webui_nginx_log "fluidd"
}
update_klipperscreen(){
stop_klipperscreen
cd $KLIPPERSCREEN_DIR
KLIPPERSCREEN_OLDREQ_MD5SUM=$(md5sum $KLIPPERSCREEN_DIR/scripts/KlipperScreen-requirements.txt | cut -d " " -f1)
git pull origin master -q && ok_msg "Fetch successfull!"
git checkout -f master && ok_msg "Checkout successfull"
#KLIPPERSCREEN_NEWREQ_MD5SUM=$(md5sum $KLIPPERSCREEN_DIR/scripts/KlipperScreen-requirements.txt)
if [[ $(md5sum $KLIPPERSCREEN_DIR/scripts/KlipperScreen-requirements.txt | cut -d " " -f1) != $KLIPPERSCREEN_OLDREQ_MD5SUM ]]; then
status_msg "New dependecies detected..."
PYTHONDIR="${HOME}/.KlipperScreen-env"
$PYTHONDIR/bin/pip install -r $KLIPPERSCREEN_DIR/scripts/KlipperScreen-requirements.txt
ok_msg "Dependencies have been installed!"
fi
ok_msg "Update complete!"
start_klipperscreen
}
update_pgc_for_klipper(){
PGC_DIR="${HOME}/pgcode"
status_msg "Updating PrettyGCode for Klipper ..."
@@ -275,17 +258,6 @@ update_pgc_for_klipper(){
ok_msg "Update complete!"
}
update_MoonrakerTelegramBot(){
source_kiauh_ini
export klipper_cfg_loc
stop_MoonrakerTelegramBot
cd $MOONRAKER_TELEGRAM_BOT_DIR
git pull
./scripts/install.sh
ok_msg "Update complete!"
start_MoonrakerTelegramBot
}
update_system(){
status_msg "Updating System ..."
sudo apt-get update --allow-releaseinfo-change && sudo apt-get upgrade -y