some changes
This commit is contained in:
4
kiauh.sh
4
kiauh.sh
@@ -39,8 +39,8 @@ OCTOPRINT_DIR=${HOME}/OctoPrint
|
|||||||
KLIPPERSCREEN_DIR=${HOME}/KlipperScreen
|
KLIPPERSCREEN_DIR=${HOME}/KlipperScreen
|
||||||
KLIPPERSCREEN_ENV_DIR=${HOME}/.KlipperScreen-env
|
KLIPPERSCREEN_ENV_DIR=${HOME}/.KlipperScreen-env
|
||||||
#MoonrakerTelegramBot
|
#MoonrakerTelegramBot
|
||||||
MOONRAKERTELEGRAMBOT_DIR=${HOME}/moonraker-telegram-bot
|
MOONRAKER_TELEGRAM_BOT_DIR=${HOME}/moonraker-telegram-bot
|
||||||
MOONRAKERTELEGRAMBOT_ENV_DIR=${HOME}/moonraker-telegram-bot-env
|
MOONRAKER_TELEGRAM_BOT_ENV_DIR=${HOME}/moonraker-telegram-bot-env
|
||||||
#misc
|
#misc
|
||||||
INI_FILE=${HOME}/.kiauh.ini
|
INI_FILE=${HOME}/.kiauh.ini
|
||||||
BACKUP_DIR=${HOME}/kiauh-backups
|
BACKUP_DIR=${HOME}/kiauh-backups
|
||||||
|
|||||||
@@ -181,13 +181,13 @@ backup_klipperscreen(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
backup_klipperscreen(){
|
backup_klipperscreen(){
|
||||||
if [ -d $MOONRAKERTELEGRAMBOT_DIR ] ; then
|
if [ -d $MOONRAKER_TELEGRAM_BOT_DIR ] ; then
|
||||||
status_msg "Creating MoonrakerTelegramBot backup ..."
|
status_msg "Creating MoonrakerTelegramBot backup ..."
|
||||||
check_for_backup_dir
|
check_for_backup_dir
|
||||||
get_date
|
get_date
|
||||||
status_msg "Timestamp: $current_date"
|
status_msg "Timestamp: $current_date"
|
||||||
mkdir -p $BACKUP_DIR/MoonrakerTelegramBot-backups/"$current_date"
|
mkdir -p $BACKUP_DIR/MoonrakerTelegramBot-backups/"$current_date"
|
||||||
cp -r $MOONRAKERTELEGRAMBOT_DIR $_
|
cp -r $MOONRAKER_TELEGRAM_BOT_DIR $_
|
||||||
ok_msg "Backup complete!"
|
ok_msg "Backup complete!"
|
||||||
else
|
else
|
||||||
ERROR_MSG=" Can't backup KlipperScreen directory!\n Not found!"
|
ERROR_MSG=" Can't backup KlipperScreen directory!\n Not found!"
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ MoonrakerTelegramBot_setup(){
|
|||||||
dependency_check
|
dependency_check
|
||||||
status_msg "Downloading MoonrakerTelegramBot ..."
|
status_msg "Downloading MoonrakerTelegramBot ..."
|
||||||
#force remove existing MoonrakerTelegramBot dir
|
#force remove existing MoonrakerTelegramBot dir
|
||||||
[ -d $MOONRAKERTELEGRAMBOT_DIR ] && rm -rf $MOONRAKERTELEGRAMBOT_DIR
|
[ -d $MOONRAKER_TELEGRAM_BOT_DIR ] && rm -rf $MOONRAKER_TELEGRAM_BOT_DIR
|
||||||
#clone into fresh MoonrakerTelegramBot dir
|
#clone into fresh MoonrakerTelegramBot dir
|
||||||
cd ${HOME} && git clone $NLEF_REPO
|
cd ${HOME} && git clone $NLEF_REPO
|
||||||
ok_msg "Download complete!"
|
ok_msg "Download complete!"
|
||||||
status_msg "Installing MoonrakerTelegramBot ..."
|
status_msg "Installing MoonrakerTelegramBot ..."
|
||||||
$MOONRAKERTELEGRAMBOT_DIR/scripts/install.sh
|
$MOONRAKER_TELEGRAM_BOT_DIR/scripts/install.sh
|
||||||
echo; ok_msg "MoonrakerTelegramBot successfully installed!"
|
echo; ok_msg "MoonrakerTelegramBot successfully installed!"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -414,15 +414,15 @@ remove_MoonrakerTelegramBot(){
|
|||||||
source_kiauh_ini
|
source_kiauh_ini
|
||||||
|
|
||||||
### remove MoonrakerTelegramBot dir
|
### remove MoonrakerTelegramBot dir
|
||||||
if [ -d $MOONRAKERTELEGRAMBOT_DIR ]; then
|
if [ -d $MOONRAKER_TELEGRAM_BOT_DIR ]; then
|
||||||
status_msg "Removing MoonrakerTelegramBot directory ..."
|
status_msg "Removing MoonrakerTelegramBot directory ..."
|
||||||
rm -rf $MOONRAKERTELEGRAMBOT_DIR && ok_msg "Directory removed!"
|
rm -rf $MOONRAKER_TELEGRAM_BOT_DIR && ok_msg "Directory removed!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### remove MoonrakerTelegramBot VENV dir
|
### remove MoonrakerTelegramBot VENV dir
|
||||||
if [ -d $MOONRAKERTELEGRAMBOT_ENV_DIR ]; then
|
if [ -d $MOONRAKER_TELEGRAM_BOT_ENV_DIR ]; then
|
||||||
status_msg "Removing MoonrakerTelegramBot VENV directory ..."
|
status_msg "Removing MoonrakerTelegramBot VENV directory ..."
|
||||||
rm -rf $MOONRAKERTELEGRAMBOT_ENV_DIR && ok_msg "Directory removed!"
|
rm -rf $MOONRAKER_TELEGRAM_BOT_ENV_DIR && ok_msg "Directory removed!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### remove MoonrakerTelegramBot service
|
### remove MoonrakerTelegramBot service
|
||||||
|
|||||||
@@ -232,8 +232,8 @@ MoonrakerTelegramBot_status(){
|
|||||||
mtbcount=0
|
mtbcount=0
|
||||||
MoonrakerTelegramBot_data=(
|
MoonrakerTelegramBot_data=(
|
||||||
SERVICE
|
SERVICE
|
||||||
$MOONRAKERTELEGRAMBOT_DIR
|
$MOONRAKER_TELEGRAM_BOT_DIR
|
||||||
$MOONRAKERTELEGRAMBOT_ENV_DIR
|
$MOONRAKER_TELEGRAM_BOT_ENV_DIR
|
||||||
)
|
)
|
||||||
|
|
||||||
### count amount of MoonrakerTelegramBot_data service files in /etc/systemd/system
|
### count amount of MoonrakerTelegramBot_data service files in /etc/systemd/system
|
||||||
@@ -250,11 +250,11 @@ MoonrakerTelegramBot_status(){
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ "$mtbcount" == "${#MoonrakerTelegramBot_data[*]}" ]; then
|
if [ "$mtbcount" == "${#MoonrakerTelegramBot_data[*]}" ]; then
|
||||||
MOONRAKERTELEGRAMBOT_STATUS="${green}Installed!${default} "
|
MOONRAKER_TELEGRAM_BOT_STATUS="${green}Installed!${default} "
|
||||||
elif [ "$mtbcount" == 0 ]; then
|
elif [ "$mtbcount" == 0 ]; then
|
||||||
MOONRAKERTELEGRAMBOT_STATUS="${red}Not installed!${default} "
|
MOONRAKER_TELEGRAM_BOT_STATUS="${red}Not installed!${default} "
|
||||||
else
|
else
|
||||||
MOONRAKERTELEGRAMBOT_STATUS="${yellow}Incomplete!${default} "
|
MOONRAKER_TELEGRAM_BOT_STATUS="${yellow}Incomplete!${default} "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -548,29 +548,29 @@ compare_klipperscreen_versions(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
read_MoonrakerTelegramBot_versions(){
|
read_MoonrakerTelegramBot_versions(){
|
||||||
if [ -d $MOONRAKERTELEGRAMBOT_DIR ] && [ -d $MOONRAKERTELEGRAMBOT_DIR/.git ]; then
|
if [ -d $MOONRAKER_TELEGRAM_BOT_DIR ] && [ -d $MOONRAKER_TELEGRAM_BOT_DIR/.git ]; then
|
||||||
cd $MOONRAKERTELEGRAMBOT_DIR
|
cd $MOONRAKER_TELEGRAM_BOT_DIR
|
||||||
git fetch origin master -q
|
git fetch origin master -q
|
||||||
LOCAL_MOONRAKERTELEGRAMBOT_COMMIT=$(git describe HEAD --always --tags | cut -d "-" -f 1,2)
|
LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT=$(git describe HEAD --always --tags | cut -d "-" -f 1,2)
|
||||||
REMOTE_MOONRAKERTELEGRAMBOT_COMMIT=$(git describe origin/master --always --tags | cut -d "-" -f 1,2)
|
REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT=$(git describe origin/master --always --tags | cut -d "-" -f 1,2)
|
||||||
else
|
else
|
||||||
LOCAL_MOONRAKERTELEGRAMBOT_COMMIT=$NONE
|
LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT=$NONE
|
||||||
REMOTE_MOONRAKERTELEGRAMBOT_COMMIT=$NONE
|
REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT=$NONE
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
compare_MoonrakerTelegramBot_versions(){
|
compare_MoonrakerTelegramBot_versions(){
|
||||||
unset MOONRAKERTELEGRAMBOT_UPDATE_AVAIL
|
unset MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL
|
||||||
read_MoonrakerTelegramBot_versions
|
read_MoonrakerTelegramBot_versions
|
||||||
if [ "$LOCAL_MOONRAKERTELEGRAMBOT_COMMIT" != "$REMOTE_MOONRAKERTELEGRAMBOT_COMMIT" ]; then
|
if [ "$LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT" != "$REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT" ]; then
|
||||||
LOCAL_MOONRAKERTELEGRAMBOT_COMMIT="${yellow}$(printf "%-12s" "$LOCAL_MOONRAKERTELEGRAMBOT_COMMIT")${default}"
|
LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT="${yellow}$(printf "%-12s" "$LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT")${default}"
|
||||||
REMOTE_MOONRAKERTELEGRAMBOT_COMMIT="${green}$(printf "%-12s" "$REMOTE_MOONRAKERTELEGRAMBOT_COMMIT")${default}"
|
REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT="${green}$(printf "%-12s" "$REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT")${default}"
|
||||||
MOONRAKERTELEGRAMBOT_UPDATE_AVAIL="true"
|
MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL="true"
|
||||||
update_arr+=(update_MoonrakerTelegramBot)
|
update_arr+=(update_MoonrakerTelegramBot)
|
||||||
else
|
else
|
||||||
LOCAL_MOONRAKERTELEGRAMBOT_COMMIT="${green}$(printf "%-12s" "$LOCAL_MOONRAKERTELEGRAMBOT_COMMIT")${default}"
|
LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT="${green}$(printf "%-12s" "$LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT")${default}"
|
||||||
REMOTE_MOONRAKERTELEGRAMBOT_COMMIT="${green}$(printf "%-12s" "$REMOTE_MOONRAKERTELEGRAMBOT_COMMIT")${default}"
|
REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT="${green}$(printf "%-12s" "$REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT")${default}"
|
||||||
MOONRAKERTELEGRAMBOT_UPDATE_AVAIL="false"
|
MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL="false"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ main_ui(){
|
|||||||
echo -e "| 4) [Advanced] | Mainsail: $MAINSAIL_STATUS|"
|
echo -e "| 4) [Advanced] | Mainsail: $MAINSAIL_STATUS|"
|
||||||
echo -e "| 5) [Backup] | Fluidd: $FLUIDD_STATUS|"
|
echo -e "| 5) [Backup] | Fluidd: $FLUIDD_STATUS|"
|
||||||
echo -e "| | KlipperScreen: $KLIPPERSCREEN_STATUS|"
|
echo -e "| | KlipperScreen: $KLIPPERSCREEN_STATUS|"
|
||||||
echo -e "| 6) [Settings] | MTelegramBot: $MOONRAKERTELEGRAMBOT_STATUS|"
|
echo -e "| 6) [Settings] | MTelegramBot: $MOONRAKER_TELEGRAM_BOT_STATUS|"
|
||||||
echo -e "| | |"
|
echo -e "| | |"
|
||||||
echo -e "| | DWC2: $DWC2_STATUS|"
|
echo -e "| | DWC2: $DWC2_STATUS|"
|
||||||
echo -e "| ${cyan}$KIAUH_VER${default}| Octoprint: $OCTOPRINT_STATUS|"
|
echo -e "| ${cyan}$KIAUH_VER${default}| Octoprint: $OCTOPRINT_STATUS|"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ update_ui(){
|
|||||||
echo -e "| 6) [DWC2-for-Klipper] | $LOCAL_DWC2FK_COMMIT | $REMOTE_DWC2FK_COMMIT | "
|
echo -e "| 6) [DWC2-for-Klipper] | $LOCAL_DWC2FK_COMMIT | $REMOTE_DWC2FK_COMMIT | "
|
||||||
echo -e "| 7) [DWC2 Web UI] | $DWC2_LOCAL_VER | $DWC2_REMOTE_VER | "
|
echo -e "| 7) [DWC2 Web UI] | $DWC2_LOCAL_VER | $DWC2_REMOTE_VER | "
|
||||||
echo -e "| 8) [PrettyGCode] | $LOCAL_PGC_COMMIT | $REMOTE_PGC_COMMIT | "
|
echo -e "| 8) [PrettyGCode] | $LOCAL_PGC_COMMIT | $REMOTE_PGC_COMMIT | "
|
||||||
echo -e "| 9) [MTelegramBot] | $LOCAL_MOONRAKERTELEGRAMBOT_COMMIT | $REMOTE_MOONRAKERTELEGRAMBOT_COMMIT | "
|
echo -e "| 9) [MTelegramBot] | $LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT | $REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT | "
|
||||||
echo -e "| |------------------------------| "
|
echo -e "| |------------------------------| "
|
||||||
echo -e "| 10) [System] | $DISPLAY_SYS_UPDATE | "
|
echo -e "| 10) [System] | $DISPLAY_SYS_UPDATE | "
|
||||||
back_footer
|
back_footer
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ update_all(){
|
|||||||
if [ "$PGC_UPDATE_AVAIL" = "true" ]; then
|
if [ "$PGC_UPDATE_AVAIL" = "true" ]; then
|
||||||
echo -e "| ${cyan}● PrettyGCode for Klipper${default} |"
|
echo -e "| ${cyan}● PrettyGCode for Klipper${default} |"
|
||||||
fi
|
fi
|
||||||
if [ "$MOONRAKERTELEGRAMBOT_UPDATE_AVAIL" = "true" ]; then
|
if [ "$MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL" = "true" ]; then
|
||||||
echo -e "| ${cyan}● MoonrakerTelegramBot${default} |"
|
echo -e "| ${cyan}● MoonrakerTelegramBot${default} |"
|
||||||
fi
|
fi
|
||||||
if [ "$SYS_UPDATE_AVAIL" = "true" ]; then
|
if [ "$SYS_UPDATE_AVAIL" = "true" ]; then
|
||||||
@@ -318,7 +318,7 @@ update_pgc_for_klipper(){
|
|||||||
|
|
||||||
update_MoonrakerTelegramBot(){
|
update_MoonrakerTelegramBot(){
|
||||||
stop_MoonrakerTelegramBot
|
stop_MoonrakerTelegramBot
|
||||||
cd $MOONRAKERTELEGRAMBOT_DIR
|
cd $MOONRAKER_TELEGRAM_BOT_DIR
|
||||||
git pull
|
git pull
|
||||||
./install.sh
|
./install.sh
|
||||||
ok_msg "Update complete!"
|
ok_msg "Update complete!"
|
||||||
|
|||||||
Reference in New Issue
Block a user