mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-16 03:54:27 +05:00
Merge branch 'dev-2.0'
This commit is contained in:
8
kiauh.sh
8
kiauh.sh
@@ -17,9 +17,9 @@ KLIPPY_ENV_DIR=${HOME}/klippy-env
|
|||||||
KLIPPER_SERVICE1=/etc/init.d/klipper
|
KLIPPER_SERVICE1=/etc/init.d/klipper
|
||||||
KLIPPER_SERVICE2=/etc/default/klipper
|
KLIPPER_SERVICE2=/etc/default/klipper
|
||||||
#dwc2
|
#dwc2
|
||||||
DWC2FK_DIR=${HOME}/dwc2-for-klipper
|
DWC2FK_DIR=${HOME}/dwc2-for-klipper-socket
|
||||||
DWC2_DIR=${HOME}/sdcard/dwc2
|
DWC_ENV_DIR=${HOME}/dwc-env
|
||||||
WEB_DWC2=${HOME}/klipper/klippy/extras/web_dwc2.py
|
DWC2_DIR=${HOME}/sdcard/web
|
||||||
#mainsail/moonraker
|
#mainsail/moonraker
|
||||||
MAINSAIL_DIR=${HOME}/mainsail
|
MAINSAIL_DIR=${HOME}/mainsail
|
||||||
MOONRAKER_DIR=${HOME}/moonraker
|
MOONRAKER_DIR=${HOME}/moonraker
|
||||||
@@ -39,7 +39,7 @@ BACKUP_DIR=${HOME}/kiauh-backups
|
|||||||
KLIPPER_REPO=https://github.com/KevinOConnor/klipper.git
|
KLIPPER_REPO=https://github.com/KevinOConnor/klipper.git
|
||||||
ARKSINE_REPO=https://github.com/Arksine/klipper.git
|
ARKSINE_REPO=https://github.com/Arksine/klipper.git
|
||||||
DMBUTYUGIN_REPO=https://github.com/dmbutyugin/klipper.git
|
DMBUTYUGIN_REPO=https://github.com/dmbutyugin/klipper.git
|
||||||
DWC2FK_REPO=https://github.com/Stephan3/dwc2-for-klipper.git
|
DWC2FK_REPO=https://github.com/Stephan3/dwc2-for-klipper-socket.git
|
||||||
MOONRAKER_REPO=https://github.com/Arksine/moonraker.git
|
MOONRAKER_REPO=https://github.com/Arksine/moonraker.git
|
||||||
#branches
|
#branches
|
||||||
BRANCH_MOONRAKER=Arksine/dev-moonraker-testing
|
BRANCH_MOONRAKER=Arksine/dev-moonraker-testing
|
||||||
|
|||||||
@@ -71,15 +71,16 @@ backup_klipper(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
backup_dwc2(){
|
backup_dwc2(){
|
||||||
if [ -d $DWC2FK_DIR ] && [ -d $DWC2_DIR ]; then
|
if [ -d $DWC2FK_DIR ] && [ -d $DWC_ENV_DIR ] && [ -d $DWC2_DIR ]; then
|
||||||
status_msg "Creating DWC2 Web UI backup ..."
|
status_msg "Creating DWC2 Web UI 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/dwc2-backups/"$current_date"
|
mkdir -p $BACKUP_DIR/dwc2-backups/"$current_date"
|
||||||
cp -r $DWC2FK_DIR $_ && cp -r $DWC2_DIR $_ && ok_msg "Backup complete!"
|
cp -r $DWC2FK_DIR $_ && cp -r $DWC_ENV_DIR $_ && cp -r $DWC2_DIR $_
|
||||||
|
ok_msg "Backup complete!"
|
||||||
else
|
else
|
||||||
ERROR_MSG=" Can't backup dwc2-for-klipper and/or dwc2 directory!\n Not found!"
|
ERROR_MSG=" Can't backup dwc2-for-klipper-socket and/or dwc2 directory!\n Not found!"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
54
scripts/dwc2-for-klipper-socket-installer/dwc-start.sh
Executable file
54
scripts/dwc2-for-klipper-socket-installer/dwc-start.sh
Executable file
@@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# System startup script for dwc2-for-klipper-socket
|
||||||
|
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: dwc2-for-klipper-socket
|
||||||
|
# Required-Start: $local_fs
|
||||||
|
# Required-Stop:
|
||||||
|
# Default-Start: 2 3 4 5
|
||||||
|
# Default-Stop: 0 1 6
|
||||||
|
# Short-Description: dwc2-for-klipper-socket daemon
|
||||||
|
# Description: Starts the dwc2-for-klipper-socket daemon.
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
DESC="dwc2-for-klipper-socket daemon"
|
||||||
|
NAME="dwc2-for-klipper-socket"
|
||||||
|
DEFAULTS_FILE=/etc/default/dwc
|
||||||
|
PIDFILE=/var/run/dwc.pid
|
||||||
|
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
|
# Read defaults file
|
||||||
|
[ -r $DEFAULTS_FILE ] && . $DEFAULTS_FILE
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start) log_daemon_msg "Starting dwc2-for-klipper-socket" $NAME
|
||||||
|
start-stop-daemon --start --quiet --exec $DWC_EXEC \
|
||||||
|
--background --pidfile $PIDFILE --make-pidfile \
|
||||||
|
--chuid $DWC_USER --user $DWC_USER \
|
||||||
|
-- $DWC_ARGS
|
||||||
|
log_end_msg $?
|
||||||
|
;;
|
||||||
|
stop) log_daemon_msg "Stopping dwc2-for-klipper-socket" $NAME
|
||||||
|
killproc -p $PIDFILE $DWC_EXEC
|
||||||
|
RETVAL=$?
|
||||||
|
[ $RETVAL -eq 0 ] && [ -e "$PIDFILE" ] && rm -f $PIDFILE
|
||||||
|
log_end_msg $RETVAL
|
||||||
|
;;
|
||||||
|
restart) log_daemon_msg "Restarting dwc2-for-klipper-socket" $NAME
|
||||||
|
$0 stop
|
||||||
|
$0 start
|
||||||
|
;;
|
||||||
|
reload|force-reload)
|
||||||
|
log_daemon_msg "Reloading configuration not supported" $NAME
|
||||||
|
log_end_msg 1
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
status_of_proc -p $PIDFILE $DWC_EXEC $NAME && exit 0 || exit $?
|
||||||
|
;;
|
||||||
|
*) log_action_msg "Usage: /etc/init.d/dwc {start|stop|status|restart|reload|force-reload}"
|
||||||
|
exit 2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
exit 0
|
||||||
106
scripts/dwc2-for-klipper-socket-installer/install-debian.sh
Executable file
106
scripts/dwc2-for-klipper-socket-installer/install-debian.sh
Executable file
@@ -0,0 +1,106 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# This script installs dwc2-for-klipper-socket on a Raspberry Pi machine running
|
||||||
|
# Raspbian/Raspberry Pi OS based distributions.
|
||||||
|
|
||||||
|
# https://github.com/Stephan3/dwc2-for-klipper-socket.git
|
||||||
|
|
||||||
|
PYTHONDIR="${HOME}/dwc-env"
|
||||||
|
SYSTEMDDIR="/etc/systemd/system"
|
||||||
|
DWC_USER=${USER}
|
||||||
|
|
||||||
|
# Step 1: Verify Klipper has been installed
|
||||||
|
check_klipper()
|
||||||
|
{
|
||||||
|
if [ "$(systemctl list-units --full -all -t service --no-legend | grep -F "klipper.service")" ]; then
|
||||||
|
echo "Klipper service found!"
|
||||||
|
else
|
||||||
|
echo "Klipper service not found, please install Klipper first"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# Step 2: Install packages
|
||||||
|
install_packages()
|
||||||
|
{
|
||||||
|
PKGLIST="python3-virtualenv python3-dev python3-tornado"
|
||||||
|
|
||||||
|
# Update system package info
|
||||||
|
report_status "Running apt-get update..."
|
||||||
|
sudo apt-get update
|
||||||
|
|
||||||
|
# Install desired packages
|
||||||
|
report_status "Installing packages..."
|
||||||
|
sudo apt-get install --yes ${PKGLIST}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Step 3: Create python virtual environment
|
||||||
|
create_virtualenv()
|
||||||
|
{
|
||||||
|
report_status "Updating python virtual environment..."
|
||||||
|
|
||||||
|
# Create virtualenv if it doesn't already exist
|
||||||
|
[ ! -d ${PYTHONDIR} ] && virtualenv -p /usr/bin/python3 ${PYTHONDIR}
|
||||||
|
|
||||||
|
# Install/update dependencies
|
||||||
|
${PYTHONDIR}/bin/pip install tornado==6.0.4
|
||||||
|
}
|
||||||
|
|
||||||
|
# Step 4: Install startup script
|
||||||
|
install_script(){
|
||||||
|
report_status "Installing system start script..."
|
||||||
|
sudo /bin/sh -c "cat > $SYSTEMDDIR/dwc.service" << EOF
|
||||||
|
#Systemd service file for DWC
|
||||||
|
[Unit]
|
||||||
|
Description=dwc_webif
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=$DWC_USER
|
||||||
|
RemainAfterExit=yes
|
||||||
|
ExecStart=${PYTHONDIR}/bin/python3 ${SRCDIR}/dwc2-for-klipper-socket/web_dwc2.py
|
||||||
|
Restart=always
|
||||||
|
RestartSec=10
|
||||||
|
EOF
|
||||||
|
# Use systemctl to enable the klipper systemd service script
|
||||||
|
sudo systemctl enable dwc.service
|
||||||
|
}
|
||||||
|
|
||||||
|
# Step 5: Start DWC service
|
||||||
|
start_software()
|
||||||
|
{
|
||||||
|
report_status "Launching dwc2-for-klipper-socket..."
|
||||||
|
sudo systemctl start dwc
|
||||||
|
}
|
||||||
|
|
||||||
|
# Helper functions
|
||||||
|
report_status()
|
||||||
|
{
|
||||||
|
echo -e "\n\n###### $1"
|
||||||
|
}
|
||||||
|
|
||||||
|
verify_ready()
|
||||||
|
{
|
||||||
|
if [ "$EUID" -eq 0 ]; then
|
||||||
|
echo "This script must not run as root"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Force script to exit if an error occurs
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Find SRCDIR from the pathname of this script
|
||||||
|
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/.. && pwd )"
|
||||||
|
|
||||||
|
# Run installation steps defined above
|
||||||
|
verify_ready
|
||||||
|
check_klipper
|
||||||
|
install_packages
|
||||||
|
create_virtualenv
|
||||||
|
install_script
|
||||||
|
start_software
|
||||||
106
scripts/dwc2-for-klipper-socket-installer/install-octopi.sh
Executable file
106
scripts/dwc2-for-klipper-socket-installer/install-octopi.sh
Executable file
@@ -0,0 +1,106 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# This script installs dwc2-for-klipper-socket on a Raspberry Pi machine running
|
||||||
|
# Raspbian/Raspberry Pi OS based distributions.
|
||||||
|
|
||||||
|
# https://github.com/Stephan3/dwc2-for-klipper-socket.git
|
||||||
|
|
||||||
|
PYTHONDIR="${HOME}/dwc-env"
|
||||||
|
|
||||||
|
# Step 1: Verify Klipper has been installed
|
||||||
|
check_klipper()
|
||||||
|
{
|
||||||
|
if [ "$(systemctl list-units --full -all -t service --no-legend | grep -F "klipper.service")" ]; then
|
||||||
|
echo "Klipper service found!"
|
||||||
|
else
|
||||||
|
echo "Klipper service not found, please install Klipper first"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# Step 2: Install packages
|
||||||
|
install_packages()
|
||||||
|
{
|
||||||
|
PKGLIST="python3-virtualenv python3-dev python3-tornado"
|
||||||
|
|
||||||
|
# Update system package info
|
||||||
|
report_status "Running apt-get update..."
|
||||||
|
sudo apt-get update
|
||||||
|
|
||||||
|
# Install desired packages
|
||||||
|
report_status "Installing packages..."
|
||||||
|
sudo apt-get install --yes ${PKGLIST}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Step 3: Create python virtual environment
|
||||||
|
create_virtualenv()
|
||||||
|
{
|
||||||
|
report_status "Updating python virtual environment..."
|
||||||
|
|
||||||
|
# Create virtualenv if it doesn't already exist
|
||||||
|
[ ! -d ${PYTHONDIR} ] && virtualenv -p /usr/bin/python3 ${PYTHONDIR}
|
||||||
|
|
||||||
|
# Install/update dependencies
|
||||||
|
${PYTHONDIR}/bin/pip install tornado==6.0.4
|
||||||
|
}
|
||||||
|
|
||||||
|
# Step 4: Install startup script
|
||||||
|
install_script(){
|
||||||
|
report_status "Installing system start script..."
|
||||||
|
sudo cp "${SRCDIR}/scripts/dwc-start.sh" /etc/init.d/dwc
|
||||||
|
sudo update-rc.d dwc defaults
|
||||||
|
}
|
||||||
|
|
||||||
|
# Step 5: Install startup script config
|
||||||
|
install_config(){
|
||||||
|
DEFAULTS_FILE=/etc/default/dwc
|
||||||
|
[ -f $DEFAULTS_FILE ] && return
|
||||||
|
|
||||||
|
report_status "Installing system start configuration..."
|
||||||
|
sudo /bin/sh -c "cat > $DEFAULTS_FILE" <<EOF
|
||||||
|
# Configuration for /etc/init.d/dwc
|
||||||
|
DWC_USER=$USER
|
||||||
|
|
||||||
|
DWC_EXEC=${PYTHONDIR}/bin/python3
|
||||||
|
|
||||||
|
DWC_ARGS="${SRCDIR}/web_dwc2.py"
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
# Step 4: Start server
|
||||||
|
start_software()
|
||||||
|
{
|
||||||
|
report_status "Launching dwc2-for-klipper-socket..."
|
||||||
|
sudo /etc/init.d/klipper stop
|
||||||
|
sudo /etc/init.d/dwc restart
|
||||||
|
sudo /etc/init.d/klipper start
|
||||||
|
}
|
||||||
|
|
||||||
|
# Helper functions
|
||||||
|
report_status()
|
||||||
|
{
|
||||||
|
echo -e "\n\n###### $1"
|
||||||
|
}
|
||||||
|
|
||||||
|
verify_ready()
|
||||||
|
{
|
||||||
|
if [ "$EUID" -eq 0 ]; then
|
||||||
|
echo "This script must not run as root"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Force script to exit if an error occurs
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Find SRCDIR from the pathname of this script
|
||||||
|
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/.. && pwd )"
|
||||||
|
|
||||||
|
# Run installation steps defined above
|
||||||
|
verify_ready
|
||||||
|
check_klipper
|
||||||
|
install_packages
|
||||||
|
create_virtualenv
|
||||||
|
install_script
|
||||||
|
install_config
|
||||||
|
start_software
|
||||||
41
scripts/dwc2-for-klipper-socket-installer/uninstall-debian.sh
Executable file
41
scripts/dwc2-for-klipper-socket-installer/uninstall-debian.sh
Executable file
@@ -0,0 +1,41 @@
|
|||||||
|
stop_service() {
|
||||||
|
# Stop DWC Service
|
||||||
|
echo "#### Stopping DWC Service.."
|
||||||
|
sudo systemctl stop dwc
|
||||||
|
sudo systemctl disable dwc
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_service() {
|
||||||
|
# Remove DWC from Services
|
||||||
|
echo
|
||||||
|
echo "#### Removing DWC Service.."
|
||||||
|
sudo rm -f /etc/systemd/system/dwc.service
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_files() {
|
||||||
|
# Remove virtualenv
|
||||||
|
if [ -d ~/dwc-env ]; then
|
||||||
|
echo "Removing virtualenv..."
|
||||||
|
rm -rf ~/dwc-env
|
||||||
|
else
|
||||||
|
echo "No DWC virtualenv found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Notify user of method to remove DWC source code
|
||||||
|
echo
|
||||||
|
echo "The DWC system files and virtualenv have been removed."
|
||||||
|
}
|
||||||
|
|
||||||
|
verify_ready()
|
||||||
|
{
|
||||||
|
if [ "$EUID" -eq 0 ]; then
|
||||||
|
echo "This script must not run as root"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
verify_ready
|
||||||
|
stop_service
|
||||||
|
remove_service
|
||||||
|
remove_files
|
||||||
45
scripts/dwc2-for-klipper-socket-installer/uninstall-octopi.sh
Executable file
45
scripts/dwc2-for-klipper-socket-installer/uninstall-octopi.sh
Executable file
@@ -0,0 +1,45 @@
|
|||||||
|
stop_service() {
|
||||||
|
# Stop DWC Service
|
||||||
|
echo "#### Stopping DWC Service.."
|
||||||
|
sudo service dwc stop
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_service() {
|
||||||
|
# Remove DWC from Startup
|
||||||
|
echo
|
||||||
|
echo "#### Removing DWC from Startup.."
|
||||||
|
sudo update-rc.d -f dwc remove
|
||||||
|
|
||||||
|
# Remove DWC from Services
|
||||||
|
echo
|
||||||
|
echo "#### Removing DWC Service.."
|
||||||
|
sudo rm -f /etc/init.d/dwc /etc/default/dwc
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_files() {
|
||||||
|
# Remove virtualenv
|
||||||
|
if [ -d ~/dwc-env ]; then
|
||||||
|
echo "Removing virtualenv..."
|
||||||
|
rm -rf ~/dwc-env
|
||||||
|
else
|
||||||
|
echo "No DWC virtualenv found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Notify user of method to remove DWC source code
|
||||||
|
echo
|
||||||
|
echo "The DWC system files and virtualenv have been removed."
|
||||||
|
}
|
||||||
|
|
||||||
|
verify_ready()
|
||||||
|
{
|
||||||
|
if [ "$EUID" -eq 0 ]; then
|
||||||
|
echo "This script must not run as root"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
verify_ready
|
||||||
|
stop_service
|
||||||
|
remove_service
|
||||||
|
remove_files
|
||||||
@@ -4,11 +4,10 @@ install_dwc2(){
|
|||||||
#ask user for customization
|
#ask user for customization
|
||||||
get_user_selections_dwc2
|
get_user_selections_dwc2
|
||||||
#dwc2 main installation
|
#dwc2 main installation
|
||||||
tornado_setup
|
stop_klipper
|
||||||
dwc2_setup
|
dwc2_setup
|
||||||
#setup config
|
#setup config
|
||||||
write_printer_cfg_dwc2
|
write_printer_cfg_dwc2
|
||||||
write_custom_printer_cfg_dwc2
|
|
||||||
#execute customizations
|
#execute customizations
|
||||||
disable_octoprint
|
disable_octoprint
|
||||||
create_reverse_proxy "dwc2"
|
create_reverse_proxy "dwc2"
|
||||||
@@ -22,7 +21,6 @@ install_dwc2(){
|
|||||||
|
|
||||||
system_check_dwc2(){
|
system_check_dwc2(){
|
||||||
status_msg "Initializing DWC2 installation ..."
|
status_msg "Initializing DWC2 installation ..."
|
||||||
stop_klipper
|
|
||||||
check_for_folder_dwc2
|
check_for_folder_dwc2
|
||||||
#check for existing printer.cfg
|
#check for existing printer.cfg
|
||||||
locate_printer_cfg
|
locate_printer_cfg
|
||||||
@@ -42,46 +40,26 @@ get_user_selections_dwc2(){
|
|||||||
#user selection for printer.cfg
|
#user selection for printer.cfg
|
||||||
if [ "$PRINTER_CFG_FOUND" = "false" ]; then
|
if [ "$PRINTER_CFG_FOUND" = "false" ]; then
|
||||||
unset SEL_DEF_CFG
|
unset SEL_DEF_CFG
|
||||||
unset SEL_CUS_CFG
|
|
||||||
while true; do
|
while true; do
|
||||||
echo
|
echo
|
||||||
top_border
|
top_border
|
||||||
echo -e "| ${red}WARNING! - No printer.cfg was found!${default} |"
|
echo -e "| ${red}WARNING! - No printer.cfg was found!${default} |"
|
||||||
hr
|
hr
|
||||||
echo -e "| You can now either select to create a printer.cfg |"
|
echo -e "| KIAUH can create a minimal printer.cfg with only the |"
|
||||||
echo -e "| with the default entries (1), customize the settings |"
|
echo -e "| necessary config entries if you wish. |"
|
||||||
echo -e "| before writing them (2) or you can skip the creation |"
|
|
||||||
echo -e "| of a printer.cfg at all. |"
|
|
||||||
echo -e "| |"
|
echo -e "| |"
|
||||||
echo -e "| Please keep in mind that DWC2 will ONLY load if you |"
|
echo -e "| Please be aware, that this option will ${red}NOT${default} create a |"
|
||||||
echo -e "| have a correctly defined printer.cfg. Any missing |"
|
echo -e "| fully working printer.cfg for you! |"
|
||||||
echo -e "| option or error will prevent DWC2 from loading and |"
|
|
||||||
echo -e "| you need to check klippy.log to resolve the error. |"
|
|
||||||
echo -e "| |"
|
|
||||||
echo -e "| ${red}Neither option 1 or 2 of this script will create a |"
|
|
||||||
echo -e "| fully working printer.cfg for you!${default} |"
|
|
||||||
hr
|
|
||||||
echo -e "| 1) [Create default configuration] |"
|
|
||||||
echo -e "| 2) [Create custom configuration] |"
|
|
||||||
echo -e "| 3) ${red}[Skip]${default} |"
|
|
||||||
bottom_border
|
bottom_border
|
||||||
read -p "${cyan}###### Please select:${default} " choice
|
read -p "${cyan}###### Create a default printer.cfg? (Y/n):${default} " yn
|
||||||
case "$choice" in
|
case "$yn" in
|
||||||
1)
|
Y|y|Yes|yes|"")
|
||||||
echo -e "###### > Create default configuration"
|
echo -e "###### > Yes"
|
||||||
SEL_DEF_CFG="true"
|
SEL_DEF_CFG="true"
|
||||||
SEL_CUS_CFG="false"
|
|
||||||
break;;
|
break;;
|
||||||
2)
|
N|n|No|no)
|
||||||
echo -e "###### > Create custom configuration"
|
echo -e "###### > No"
|
||||||
SEL_DEF_CFG="false"
|
SEL_DEF_CFG="false"
|
||||||
SEL_CUS_CFG="true"
|
|
||||||
break;;
|
|
||||||
3)
|
|
||||||
echo -e "###### > Skip"
|
|
||||||
SEL_DEF_CFG="false"
|
|
||||||
SEL_CUS_CFG="false"
|
|
||||||
echo "${red}Skipping ...${default}"
|
|
||||||
break;;
|
break;;
|
||||||
*)
|
*)
|
||||||
print_unkown_cmd
|
print_unkown_cmd
|
||||||
@@ -130,21 +108,8 @@ get_user_selections_dwc2(){
|
|||||||
|
|
||||||
check_for_folder_dwc2(){
|
check_for_folder_dwc2(){
|
||||||
#check for needed folder
|
#check for needed folder
|
||||||
if [ ! -d $DWC2_DIR/web ]; then
|
if [ ! -d $DWC2_DIR ]; then
|
||||||
mkdir -p $DWC2_DIR/web
|
mkdir -p $DWC2_DIR
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
tornado_setup(){
|
|
||||||
if [ "$(cd $KLIPPY_ENV_DIR/bin/ && $_/pip list 2>/dev/null | grep "tornado" | cut -d" " -f9)" = "5.1.1" ]; then
|
|
||||||
ok_msg "Tornado 5.1.1 is already installed! Continue..."
|
|
||||||
else
|
|
||||||
status_msg "Installing Tornado 5.1.1 ..."
|
|
||||||
cd ${HOME}
|
|
||||||
PYTHONDIR="${HOME}/klippy-env"
|
|
||||||
virtualenv ${PYTHONDIR}
|
|
||||||
${PYTHONDIR}/bin/pip install tornado==5.1.1
|
|
||||||
ok_msg "Tornado 5.1.1 successfully installed!"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,20 +119,43 @@ dwc2_setup(){
|
|||||||
dependency_check
|
dependency_check
|
||||||
#get dwc2-for-klipper
|
#get dwc2-for-klipper
|
||||||
cd ${HOME}
|
cd ${HOME}
|
||||||
status_msg "Cloning DWC2-for-Klipper repository ..."
|
status_msg "Cloning DWC2-for-Klipper-Socket repository ..."
|
||||||
git clone $DWC2FK_REPO
|
git clone $DWC2FK_REPO
|
||||||
ok_msg "DWC2-for-Klipper successfully cloned!"
|
ok_msg "DWC2-for-Klipper successfully cloned!"
|
||||||
#create a web_dwc2.py symlink if not already existing
|
#copy installers from kiauh srcdir to dwc-for-klipper-socket
|
||||||
if [ -d $KLIPPER_DIR/klippy/extras ] && [ ! -e $KLIPPER_DIR/klippy/extras/web_dwc2.py ]; then
|
status_msg "Copy installers to $DWC2FK_DIR"
|
||||||
status_msg "Creating web_dwc2.py Symlink ..."
|
cp -r ${SRCDIR}/kiauh/scripts/dwc2-for-klipper-socket-installer $DWC2FK_DIR/scripts
|
||||||
ln -s $DWC2FK_DIR/web_dwc2.py $KLIPPER_DIR/klippy/extras/web_dwc2.py
|
ok_msg "Done!"
|
||||||
ok_msg "Symlink created!"
|
status_msg "Starting service-installer ..."
|
||||||
|
$DWC2FK_DIR/scripts/install-octopi.sh
|
||||||
|
ok_msg "Service installed!"
|
||||||
|
#patch /etc/default/klipper to append the uds argument
|
||||||
|
patch_klipper_sysfile_dwc2
|
||||||
|
#download Duet Web Control
|
||||||
|
download_dwc2_webui
|
||||||
|
}
|
||||||
|
|
||||||
|
patch_klipper_sysfile_dwc2(){
|
||||||
|
status_msg "Checking /etc/default/klipper for necessary entries ..."
|
||||||
|
#patching new UDS argument to /etc/default/klipper
|
||||||
|
if ! grep -q -- "-a /tmp/klippy_uds" $KLIPPER_SERVICE2; then
|
||||||
|
status_msg "Patching unix domain socket to /etc/default/klipper ..."
|
||||||
|
#append the new argument to /tmp/klippy.log argument
|
||||||
|
sudo sed -i "/KLIPPY_ARGS/s/\.log/\.log -a \/tmp\/klippy_uds/" $KLIPPER_SERVICE2
|
||||||
|
ok_msg "Patching done!"
|
||||||
|
else
|
||||||
|
ok_msg "No patching needed!"
|
||||||
fi
|
fi
|
||||||
|
ok_msg "Check complete!"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
download_dwc2_webui(){
|
||||||
#get Duet Web Control
|
#get Duet Web Control
|
||||||
GET_DWC2_URL=`curl -s https://api.github.com/repositories/28820678/releases/latest | grep browser_download_url | cut -d'"' -f4`
|
GET_DWC2_URL=`curl -s https://api.github.com/repositories/28820678/releases/latest | grep browser_download_url | cut -d'"' -f4`
|
||||||
cd $DWC2_DIR/web
|
cd $DWC2_DIR
|
||||||
status_msg "Downloading DWC2 Web UI ..."
|
status_msg "Downloading DWC2 Web UI ..."
|
||||||
wget -q $GET_DWC2_URL
|
wget $GET_DWC2_URL
|
||||||
ok_msg "Download complete!"
|
ok_msg "Download complete!"
|
||||||
status_msg "Unzipping archive ..."
|
status_msg "Unzipping archive ..."
|
||||||
unzip -q -o *.zip
|
unzip -q -o *.zip
|
||||||
@@ -177,7 +165,7 @@ dwc2_setup(){
|
|||||||
done
|
done
|
||||||
ok_msg "Done!"
|
ok_msg "Done!"
|
||||||
status_msg "Writing DWC version to file ..."
|
status_msg "Writing DWC version to file ..."
|
||||||
echo $GET_DWC2_URL | cut -d/ -f8 > $DWC2_DIR/web/version
|
echo $GET_DWC2_URL | cut -d/ -f8 > $DWC2_DIR/version
|
||||||
ok_msg "Done!"
|
ok_msg "Done!"
|
||||||
status_msg "Do a little cleanup ..."
|
status_msg "Do a little cleanup ..."
|
||||||
rm -rf DuetWebControl-SD.zip
|
rm -rf DuetWebControl-SD.zip
|
||||||
@@ -198,11 +186,6 @@ setup_printer_config_dwc2(){
|
|||||||
create_default_dwc2_printer_cfg
|
create_default_dwc2_printer_cfg
|
||||||
locate_printer_cfg
|
locate_printer_cfg
|
||||||
fi
|
fi
|
||||||
if [ "$SEL_CUS_CFG" = "true" ]; then
|
|
||||||
#get user input for custom config
|
|
||||||
create_custom_dwc2_printer_cfg
|
|
||||||
locate_printer_cfg
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
read_printer_cfg_dwc2(){
|
read_printer_cfg_dwc2(){
|
||||||
@@ -211,9 +194,6 @@ read_printer_cfg_dwc2(){
|
|||||||
if [ ! $(grep '^\[virtual_sdcard\]$' $PRINTER_CFG) ]; then
|
if [ ! $(grep '^\[virtual_sdcard\]$' $PRINTER_CFG) ]; then
|
||||||
VSD="false"
|
VSD="false"
|
||||||
fi
|
fi
|
||||||
if [ ! $(grep '^\[web_dwc2\]$' $PRINTER_CFG) ]; then
|
|
||||||
WEB_DWC2="false"
|
|
||||||
fi
|
|
||||||
#check for a SAVE_CONFIG entry
|
#check for a SAVE_CONFIG entry
|
||||||
if [[ $(grep "$SC" $PRINTER_CFG) ]]; then
|
if [[ $(grep "$SC" $PRINTER_CFG) ]]; then
|
||||||
SC_LINE=$(grep -n "$SC" $PRINTER_CFG | cut -d ":" -f1)
|
SC_LINE=$(grep -n "$SC" $PRINTER_CFG | cut -d ":" -f1)
|
||||||
@@ -226,9 +206,6 @@ read_printer_cfg_dwc2(){
|
|||||||
|
|
||||||
write_printer_cfg_dwc2(){
|
write_printer_cfg_dwc2(){
|
||||||
unset write_entries
|
unset write_entries
|
||||||
if [ "$WEB_DWC2" = "false" ]; then
|
|
||||||
write_entries+=("[web_dwc2]\nprinter_name: my_printer\nlisten_adress: 0.0.0.0\nlisten_port: 4750\nweb_path: dwc2/web")
|
|
||||||
fi
|
|
||||||
if [ "$VSD" = "false" ]; then
|
if [ "$VSD" = "false" ]; then
|
||||||
write_entries+=("[virtual_sdcard]\npath: ~/sdcard")
|
write_entries+=("[virtual_sdcard]\npath: ~/sdcard")
|
||||||
fi
|
fi
|
||||||
@@ -255,17 +232,9 @@ write_printer_cfg_dwc2(){
|
|||||||
ok_msg "Done!"
|
ok_msg "Done!"
|
||||||
}
|
}
|
||||||
|
|
||||||
write_custom_printer_cfg_dwc2(){
|
|
||||||
#create custom config
|
|
||||||
if [ "$PRINTER_CFG_FOUND" = "false" ] && [ "$CONFIRM_CUSTOM_CFG" = "true" ]; then
|
|
||||||
touch $PRINTER_CFG
|
|
||||||
echo -e "$DWC2_CFG" >> $PRINTER_CFG
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
create_default_dwc2_printer_cfg(){
|
create_default_dwc2_printer_cfg(){
|
||||||
#create default config
|
#create default config
|
||||||
if [ "$PRINTER_CFG_FOUND" = "false" ] && [ "$SEL_CUS_CFG" = "true" ]; then
|
if [ "$PRINTER_CFG_FOUND" = "false" ] && [ "$SEL_DEF_CFG" = "true" ]; then
|
||||||
touch $PRINTER_CFG
|
touch $PRINTER_CFG
|
||||||
cat <<DEFAULT_DWC2_CFG >> $PRINTER_CFG
|
cat <<DEFAULT_DWC2_CFG >> $PRINTER_CFG
|
||||||
##########################
|
##########################
|
||||||
@@ -281,11 +250,6 @@ max_z_accel: 100
|
|||||||
[virtual_sdcard]
|
[virtual_sdcard]
|
||||||
path: ~/sdcard
|
path: ~/sdcard
|
||||||
|
|
||||||
[web_dwc2]
|
|
||||||
printer_name: my_printer
|
|
||||||
listen_adress: 0.0.0.0
|
|
||||||
listen_port: 4750
|
|
||||||
web_path: dwc2/web
|
|
||||||
##########################
|
##########################
|
||||||
DEFAULT_DWC2_CFG
|
DEFAULT_DWC2_CFG
|
||||||
fi
|
fi
|
||||||
@@ -294,57 +258,6 @@ DEFAULT_DWC2_CFG
|
|||||||
#############################################################
|
#############################################################
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
create_custom_dwc2_printer_cfg(){
|
|
||||||
echo
|
|
||||||
top_border
|
|
||||||
echo -e "| Please fill in custom values for the following |"
|
|
||||||
echo -e "| configuration options. If you are unsure what to put |"
|
|
||||||
echo -e "| in, keep the pre-entered values. |"
|
|
||||||
bottom_border
|
|
||||||
echo -e "${cyan}"
|
|
||||||
read -e -p "Printer name: " -i "my_printer" PRINTER_NAME
|
|
||||||
read -e -p "Listen adress: " -i "0.0.0.0" LISTEN_ADRESS
|
|
||||||
read -e -p "Listen port: " -i "4750" LISTEN_PORT
|
|
||||||
read -e -p "Web path: " -i "dwc2/web" WEB_PATH
|
|
||||||
echo -e "${default}"
|
|
||||||
DWC2_CFG=$(cat <<DWC2
|
|
||||||
##########################
|
|
||||||
### CREATED WITH KIAUH ###
|
|
||||||
##########################
|
|
||||||
[virtual_sdcard]
|
|
||||||
path: ~/sdcard
|
|
||||||
|
|
||||||
[web_dwc2]
|
|
||||||
printer_name: $PRINTER_NAME
|
|
||||||
listen_adress: $LISTEN_ADRESS
|
|
||||||
listen_port: $LISTEN_PORT
|
|
||||||
web_path: $WEB_PATH
|
|
||||||
##########################
|
|
||||||
DWC2
|
|
||||||
)
|
|
||||||
echo "The following lines will be written:"
|
|
||||||
echo -e "$DWC2_CFG"
|
|
||||||
while true; do
|
|
||||||
echo
|
|
||||||
read -p "${cyan}###### Confirm (Y) or start over (n)? (Y/n):${default} " yn
|
|
||||||
case "$yn" in
|
|
||||||
Y|y|Yes|yes|"")
|
|
||||||
CONFIRM_CUSTOM_CFG="true"
|
|
||||||
break;;
|
|
||||||
N|n|No|no)
|
|
||||||
CONFIRM_CUSTOM_CFG="false"
|
|
||||||
create_custom_dwc2_printer_cfg
|
|
||||||
break;;
|
|
||||||
*)
|
|
||||||
print_unkown_cmd
|
|
||||||
print_msg && clear_msg;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
#############################################################
|
|
||||||
#############################################################
|
|
||||||
|
|
||||||
dwc2_reverse_proxy_dialog(){
|
dwc2_reverse_proxy_dialog(){
|
||||||
unset SET_REVERSE_PROXY
|
unset SET_REVERSE_PROXY
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -11,8 +11,10 @@ remove_klipper(){
|
|||||||
stop_klipper
|
stop_klipper
|
||||||
if [[ -e /etc/init.d/klipper || -e /etc/default/klipper ]]; then
|
if [[ -e /etc/init.d/klipper || -e /etc/default/klipper ]]; then
|
||||||
status_msg "Removing Klipper Service ..."
|
status_msg "Removing Klipper Service ..."
|
||||||
|
sudo rm -rf /etc/init.d/klipper /etc/default/klipper
|
||||||
sudo update-rc.d -f klipper remove
|
sudo update-rc.d -f klipper remove
|
||||||
sudo rm -rf /etc/init.d/klipper /etc/default/klipper && ok_msg "Klipper Service removed!"
|
systemctl daemon-reload
|
||||||
|
ok_msg "Klipper Service removed!"
|
||||||
fi
|
fi
|
||||||
if [[ -d $KLIPPER_DIR || -d $KLIPPY_ENV_DIR ]]; then
|
if [[ -d $KLIPPER_DIR || -d $KLIPPY_ENV_DIR ]]; then
|
||||||
status_msg "Removing Klipper and klippy-env directory ..."
|
status_msg "Removing Klipper and klippy-env directory ..."
|
||||||
@@ -26,38 +28,50 @@ remove_klipper(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#############################################################
|
||||||
|
#############################################################
|
||||||
|
|
||||||
remove_dwc2(){
|
remove_dwc2(){
|
||||||
data_arr=(
|
data_arr=(
|
||||||
$TORNADO_DIR1
|
/etc/init.d/dwc
|
||||||
$TORNADO_DIR2
|
/etc/default/dwc
|
||||||
$DWC2FK_DIR
|
$DWC2FK_DIR
|
||||||
$WEB_DWC2
|
$DWC_ENV_DIR
|
||||||
$DWC2_DIR
|
$DWC2_DIR
|
||||||
)
|
)
|
||||||
print_error "DWC2-for-Klipper &\n DWC2 Web UI" && data_count=()
|
print_error "DWC2-for-Klipper-Socket &\n DWC2 Web UI" && data_count=()
|
||||||
if [ "$ERROR_MSG" = "" ]; then
|
if [ "$ERROR_MSG" = "" ]; then
|
||||||
if [ -d $TORNADO_DIR1 ]; then
|
if systemctl is-active dwc -q; then
|
||||||
status_msg "Removing Tornado from klippy-env ..."
|
status_msg "Stopping DWC2-for-Klipper-Socket Service ..."
|
||||||
PYTHONDIR=$KLIPPY_ENV_DIR
|
sudo /etc/init.d/dwc stop && sudo systemctl disable dwc
|
||||||
$PYTHONDIR/bin/pip uninstall tornado -y
|
ok_msg "Service stopped!"
|
||||||
CONFIRM_MSG=" Tornado successfully removed!"
|
fi
|
||||||
|
if [[ -e /etc/init.d/dwc || -e /etc/default/dwc ]]; then
|
||||||
|
status_msg "Removing DWC2-for-Klipper-Socket Service ..."
|
||||||
|
sudo rm -rf /etc/init.d/dwc /etc/default/dwc
|
||||||
|
sudo update-rc.d -f dwc remove
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
ok_msg "DWC2-for-Klipper-Socket Service removed!"
|
||||||
fi
|
fi
|
||||||
if [ -d $DWC2FK_DIR ]; then
|
if [ -d $DWC2FK_DIR ]; then
|
||||||
status_msg "Removing DWC2-for-Klipper directory ..."
|
status_msg "Removing DWC2-for-Klipper-Socket directory ..."
|
||||||
rm -rf $DWC2FK_DIR && ok_msg "Directory removed!"
|
rm -rf $DWC2FK_DIR && ok_msg "Directory removed!"
|
||||||
fi
|
fi
|
||||||
if [ -e $WEB_DWC2 ]; then
|
if [ -d $DWC_ENV_DIR ]; then
|
||||||
status_msg "Removing web_dwc2.py Symlink from klippy ..."
|
status_msg "Removing DWC2-for-Klipper-Socket virtualenv ..."
|
||||||
rm -rf $WEB_DWC2 && ok_msg "File removed!"
|
rm -rf $DWC_ENV_DIR && ok_msg "File removed!"
|
||||||
fi
|
fi
|
||||||
if [ -d $DWC2_DIR ]; then
|
if [ -d $DWC2_DIR ]; then
|
||||||
status_msg "Removing DWC2 directory ..."
|
status_msg "Removing DWC2 directory ..."
|
||||||
rm -rf $DWC2_DIR && ok_msg "Directory removed!"
|
rm -rf $DWC2_DIR && ok_msg "Directory removed!"
|
||||||
fi
|
fi
|
||||||
CONFIRM_MSG=" DWC2-for-Klipper & DWC2 Web UI successfully removed!"
|
CONFIRM_MSG=" DWC2-for-Klipper-Socket & DWC2 successfully removed!"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#############################################################
|
||||||
|
#############################################################
|
||||||
|
|
||||||
remove_moonraker(){
|
remove_moonraker(){
|
||||||
data_arr=(
|
data_arr=(
|
||||||
$MOONRAKER_SERVICE1
|
$MOONRAKER_SERVICE1
|
||||||
@@ -131,6 +145,9 @@ remove_moonraker(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#############################################################
|
||||||
|
#############################################################
|
||||||
|
|
||||||
remove_mainsail(){
|
remove_mainsail(){
|
||||||
data_arr=(
|
data_arr=(
|
||||||
$MAINSAIL_DIR
|
$MAINSAIL_DIR
|
||||||
@@ -158,6 +175,9 @@ remove_mainsail(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#############################################################
|
||||||
|
#############################################################
|
||||||
|
|
||||||
remove_octoprint(){
|
remove_octoprint(){
|
||||||
data_arr=(
|
data_arr=(
|
||||||
$OCTOPRINT_SERVICE1
|
$OCTOPRINT_SERVICE1
|
||||||
@@ -192,6 +212,9 @@ remove_octoprint(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#############################################################
|
||||||
|
#############################################################
|
||||||
|
|
||||||
remove_nginx(){
|
remove_nginx(){
|
||||||
if [[ $(dpkg-query -f'${Status}' --show nginx 2>/dev/null) = *\ installed ]] ; then
|
if [[ $(dpkg-query -f'${Status}' --show nginx 2>/dev/null) = *\ installed ]] ; then
|
||||||
if systemctl is-active nginx -q; then
|
if systemctl is-active nginx -q; then
|
||||||
@@ -202,6 +225,7 @@ remove_nginx(){
|
|||||||
status_msg "Purging Nginx from system ..."
|
status_msg "Purging Nginx from system ..."
|
||||||
sudo apt-get purge nginx nginx-common -y
|
sudo apt-get purge nginx nginx-common -y
|
||||||
sudo update-rc.d -f nginx remove
|
sudo update-rc.d -f nginx remove
|
||||||
|
sudo systemctl daemon-reload
|
||||||
CONFIRM_MSG=" Nginx successfully removed!"
|
CONFIRM_MSG=" Nginx successfully removed!"
|
||||||
else
|
else
|
||||||
ERROR_MSG=" Looks like Nginx was already removed!\n Skipping..."
|
ERROR_MSG=" Looks like Nginx was already removed!\n Skipping..."
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ dwc2_status(){
|
|||||||
dcount=0
|
dcount=0
|
||||||
dwc2_data=(
|
dwc2_data=(
|
||||||
$DWC2FK_DIR
|
$DWC2FK_DIR
|
||||||
$WEB_DWC2
|
$DWC_ENV_DIR
|
||||||
$DWC2_DIR
|
$DWC2_DIR
|
||||||
)
|
)
|
||||||
#count+1 for each found data-item from array
|
#count+1 for each found data-item from array
|
||||||
@@ -113,6 +113,9 @@ octoprint_status(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#############################################################
|
||||||
|
#############################################################
|
||||||
|
|
||||||
#reading the log for the last branch that got checked out assuming that this is also the currently active branch.
|
#reading the log for the last branch that got checked out assuming that this is also the currently active branch.
|
||||||
read_branch(){
|
read_branch(){
|
||||||
if [ -d $KLIPPER_DIR/.git ]; then
|
if [ -d $KLIPPER_DIR/.git ]; then
|
||||||
@@ -184,6 +187,9 @@ compare_klipper_versions(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#############################################################
|
||||||
|
#############################################################
|
||||||
|
|
||||||
read_dwc2fk_versions(){
|
read_dwc2fk_versions(){
|
||||||
if [ -d $DWC2FK_DIR ] && [ -d $DWC2FK_DIR/.git ]; then
|
if [ -d $DWC2FK_DIR ] && [ -d $DWC2FK_DIR/.git ]; then
|
||||||
cd $DWC2FK_DIR
|
cd $DWC2FK_DIR
|
||||||
@@ -210,8 +216,8 @@ compare_dwc2fk_versions(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
read_local_dwc2_version(){
|
read_local_dwc2_version(){
|
||||||
if [ -e $DWC2_DIR/web/version ]; then
|
if [ -e $DWC2_DIR/version ]; then
|
||||||
DWC2_LOCAL_VER=$(head -n 1 $DWC2_DIR/web/version)
|
DWC2_LOCAL_VER=$(head -n 1 $DWC2_DIR/version)
|
||||||
else
|
else
|
||||||
DWC2_LOCAL_VER="${red}-----${default}"
|
DWC2_LOCAL_VER="${red}-----${default}"
|
||||||
fi
|
fi
|
||||||
@@ -240,6 +246,9 @@ compare_dwc2_versions(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#############################################################
|
||||||
|
#############################################################
|
||||||
|
|
||||||
read_local_mainsail_version(){
|
read_local_mainsail_version(){
|
||||||
if [ -e $MAINSAIL_DIR/version ]; then
|
if [ -e $MAINSAIL_DIR/version ]; then
|
||||||
MAINSAIL_LOCAL_VER=$(head -n 1 $MAINSAIL_DIR/version)
|
MAINSAIL_LOCAL_VER=$(head -n 1 $MAINSAIL_DIR/version)
|
||||||
|
|||||||
@@ -39,18 +39,13 @@ update_dwc2fk(){
|
|||||||
cd ${HOME} && git clone $DWC2FK_REPO
|
cd ${HOME} && git clone $DWC2FK_REPO
|
||||||
else
|
else
|
||||||
cd $DWC2FK_DIR && git pull
|
cd $DWC2FK_DIR && git pull
|
||||||
#create a web_dwc2.py symlink if not already existing
|
|
||||||
if [ -d $KLIPPER_DIR/klippy/extras ] && [ ! -e $WEB_DWC2 ]; then
|
|
||||||
status_msg "Creating web_dwc2.py Symlink ..."
|
|
||||||
ln -s $DWC2FK_DIR/web_dwc2.py $WEB_DWC2 && ok_msg "Symlink created!"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
start_klipper
|
start_klipper
|
||||||
}
|
}
|
||||||
|
|
||||||
update_dwc2(){
|
update_dwc2(){
|
||||||
bb4u "dwc2"
|
bb4u "dwc2"
|
||||||
install_dwc2
|
download_dwc2_webui
|
||||||
}
|
}
|
||||||
|
|
||||||
update_mainsail(){
|
update_mainsail(){
|
||||||
|
|||||||
Reference in New Issue
Block a user