some changes
This commit is contained in:
@@ -181,13 +181,13 @@ backup_klipperscreen(){
|
||||
}
|
||||
|
||||
backup_klipperscreen(){
|
||||
if [ -d $MOONRAKERTELEGRAMBOT_DIR ] ; then
|
||||
if [ -d $MOONRAKER_TELEGRAM_BOT_DIR ] ; then
|
||||
status_msg "Creating MoonrakerTelegramBot backup ..."
|
||||
check_for_backup_dir
|
||||
get_date
|
||||
status_msg "Timestamp: $current_date"
|
||||
mkdir -p $BACKUP_DIR/MoonrakerTelegramBot-backups/"$current_date"
|
||||
cp -r $MOONRAKERTELEGRAMBOT_DIR $_
|
||||
cp -r $MOONRAKER_TELEGRAM_BOT_DIR $_
|
||||
ok_msg "Backup complete!"
|
||||
else
|
||||
ERROR_MSG=" Can't backup KlipperScreen directory!\n Not found!"
|
||||
|
||||
@@ -11,11 +11,11 @@ MoonrakerTelegramBot_setup(){
|
||||
dependency_check
|
||||
status_msg "Downloading MoonrakerTelegramBot ..."
|
||||
#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
|
||||
cd ${HOME} && git clone $NLEF_REPO
|
||||
ok_msg "Download complete!"
|
||||
status_msg "Installing MoonrakerTelegramBot ..."
|
||||
$MOONRAKERTELEGRAMBOT_DIR/scripts/install.sh
|
||||
$MOONRAKER_TELEGRAM_BOT_DIR/scripts/install.sh
|
||||
echo; ok_msg "MoonrakerTelegramBot successfully installed!"
|
||||
}
|
||||
|
||||
@@ -414,15 +414,15 @@ remove_MoonrakerTelegramBot(){
|
||||
source_kiauh_ini
|
||||
|
||||
### remove MoonrakerTelegramBot dir
|
||||
if [ -d $MOONRAKERTELEGRAMBOT_DIR ]; then
|
||||
if [ -d $MOONRAKER_TELEGRAM_BOT_DIR ]; then
|
||||
status_msg "Removing MoonrakerTelegramBot directory ..."
|
||||
rm -rf $MOONRAKERTELEGRAMBOT_DIR && ok_msg "Directory removed!"
|
||||
rm -rf $MOONRAKER_TELEGRAM_BOT_DIR && ok_msg "Directory removed!"
|
||||
fi
|
||||
|
||||
### remove MoonrakerTelegramBot VENV dir
|
||||
if [ -d $MOONRAKERTELEGRAMBOT_ENV_DIR ]; then
|
||||
if [ -d $MOONRAKER_TELEGRAM_BOT_ENV_DIR ]; then
|
||||
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
|
||||
|
||||
### remove MoonrakerTelegramBot service
|
||||
|
||||
@@ -232,8 +232,8 @@ MoonrakerTelegramBot_status(){
|
||||
mtbcount=0
|
||||
MoonrakerTelegramBot_data=(
|
||||
SERVICE
|
||||
$MOONRAKERTELEGRAMBOT_DIR
|
||||
$MOONRAKERTELEGRAMBOT_ENV_DIR
|
||||
$MOONRAKER_TELEGRAM_BOT_DIR
|
||||
$MOONRAKER_TELEGRAM_BOT_ENV_DIR
|
||||
)
|
||||
|
||||
### count amount of MoonrakerTelegramBot_data service files in /etc/systemd/system
|
||||
@@ -250,11 +250,11 @@ MoonrakerTelegramBot_status(){
|
||||
fi
|
||||
done
|
||||
if [ "$mtbcount" == "${#MoonrakerTelegramBot_data[*]}" ]; then
|
||||
MOONRAKERTELEGRAMBOT_STATUS="${green}Installed!${default} "
|
||||
MOONRAKER_TELEGRAM_BOT_STATUS="${green}Installed!${default} "
|
||||
elif [ "$mtbcount" == 0 ]; then
|
||||
MOONRAKERTELEGRAMBOT_STATUS="${red}Not installed!${default} "
|
||||
MOONRAKER_TELEGRAM_BOT_STATUS="${red}Not installed!${default} "
|
||||
else
|
||||
MOONRAKERTELEGRAMBOT_STATUS="${yellow}Incomplete!${default} "
|
||||
MOONRAKER_TELEGRAM_BOT_STATUS="${yellow}Incomplete!${default} "
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -548,29 +548,29 @@ compare_klipperscreen_versions(){
|
||||
}
|
||||
|
||||
read_MoonrakerTelegramBot_versions(){
|
||||
if [ -d $MOONRAKERTELEGRAMBOT_DIR ] && [ -d $MOONRAKERTELEGRAMBOT_DIR/.git ]; then
|
||||
cd $MOONRAKERTELEGRAMBOT_DIR
|
||||
if [ -d $MOONRAKER_TELEGRAM_BOT_DIR ] && [ -d $MOONRAKER_TELEGRAM_BOT_DIR/.git ]; then
|
||||
cd $MOONRAKER_TELEGRAM_BOT_DIR
|
||||
git fetch origin master -q
|
||||
LOCAL_MOONRAKERTELEGRAMBOT_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)
|
||||
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_MOONRAKERTELEGRAMBOT_COMMIT=$NONE
|
||||
REMOTE_MOONRAKERTELEGRAMBOT_COMMIT=$NONE
|
||||
LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT=$NONE
|
||||
REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT=$NONE
|
||||
fi
|
||||
}
|
||||
|
||||
compare_MoonrakerTelegramBot_versions(){
|
||||
unset MOONRAKERTELEGRAMBOT_UPDATE_AVAIL
|
||||
unset MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL
|
||||
read_MoonrakerTelegramBot_versions
|
||||
if [ "$LOCAL_MOONRAKERTELEGRAMBOT_COMMIT" != "$REMOTE_MOONRAKERTELEGRAMBOT_COMMIT" ]; then
|
||||
LOCAL_MOONRAKERTELEGRAMBOT_COMMIT="${yellow}$(printf "%-12s" "$LOCAL_MOONRAKERTELEGRAMBOT_COMMIT")${default}"
|
||||
REMOTE_MOONRAKERTELEGRAMBOT_COMMIT="${green}$(printf "%-12s" "$REMOTE_MOONRAKERTELEGRAMBOT_COMMIT")${default}"
|
||||
MOONRAKERTELEGRAMBOT_UPDATE_AVAIL="true"
|
||||
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}"
|
||||
MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL="true"
|
||||
update_arr+=(update_MoonrakerTelegramBot)
|
||||
else
|
||||
LOCAL_MOONRAKERTELEGRAMBOT_COMMIT="${green}$(printf "%-12s" "$LOCAL_MOONRAKERTELEGRAMBOT_COMMIT")${default}"
|
||||
REMOTE_MOONRAKERTELEGRAMBOT_COMMIT="${green}$(printf "%-12s" "$REMOTE_MOONRAKERTELEGRAMBOT_COMMIT")${default}"
|
||||
MOONRAKERTELEGRAMBOT_UPDATE_AVAIL="false"
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ main_ui(){
|
||||
echo -e "| 4) [Advanced] | Mainsail: $MAINSAIL_STATUS|"
|
||||
echo -e "| 5) [Backup] | Fluidd: $FLUIDD_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 "| | DWC2: $DWC2_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 "| 7) [DWC2 Web UI] | $DWC2_LOCAL_VER | $DWC2_REMOTE_VER | "
|
||||
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 "| 10) [System] | $DISPLAY_SYS_UPDATE | "
|
||||
back_footer
|
||||
|
||||
@@ -42,7 +42,7 @@ update_all(){
|
||||
if [ "$PGC_UPDATE_AVAIL" = "true" ]; then
|
||||
echo -e "| ${cyan}● PrettyGCode for Klipper${default} |"
|
||||
fi
|
||||
if [ "$MOONRAKERTELEGRAMBOT_UPDATE_AVAIL" = "true" ]; then
|
||||
if [ "$MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL" = "true" ]; then
|
||||
echo -e "| ${cyan}● MoonrakerTelegramBot${default} |"
|
||||
fi
|
||||
if [ "$SYS_UPDATE_AVAIL" = "true" ]; then
|
||||
@@ -318,7 +318,7 @@ update_pgc_for_klipper(){
|
||||
|
||||
update_MoonrakerTelegramBot(){
|
||||
stop_MoonrakerTelegramBot
|
||||
cd $MOONRAKERTELEGRAMBOT_DIR
|
||||
cd $MOONRAKER_TELEGRAM_BOT_DIR
|
||||
git pull
|
||||
./install.sh
|
||||
ok_msg "Update complete!"
|
||||
|
||||
Reference in New Issue
Block a user