mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-11 17:44:28 +05:00
update script to use mainsail beta - dropping mainsail alpha
This commit is contained in:
13
README.md
13
README.md
@@ -11,7 +11,7 @@
|
||||
|
||||
## First things first: When you decide to use this script, you use it at your own risk!
|
||||
|
||||
Give it a try if you want and if you have suggestions or encounter any problems, please report them to me.
|
||||
Give it a try if you want and if you have suggestions or encounter any problems, please report them to me.
|
||||
|
||||
## Instructions:
|
||||
|
||||
@@ -34,11 +34,12 @@ chmod +x ~/kiauh/scripts/*
|
||||
|
||||
- Tested only on Raspbian Buster Lite
|
||||
- During the use of this script you will be asked for your sudo password. There are several functions involved which need sudo privileges.
|
||||
- Prevent simultaneous use of DWC2 and OctoPrint if possible. There have been reports that DWC2 does strange things while the OctoPrint service is running while using the DWC2 webinterface. The script disables an existing OctoPrint service when installing DWC2. However, the service can also be reactivated with the script!
|
||||
- Prevent simultaneous use of DWC2 and OctoPrint if possible. There have been reports that DWC2 does strange things while the OctoPrint service is running while using the DWC2 webinterface. The script disables an existing OctoPrint service when installing DWC2. However, the service can also be reactivated with the script!
|
||||
|
||||
## Functions and Features:
|
||||
|
||||
### Core Functions:
|
||||
|
||||
- **Install:** Klipper Firmware, dwc2-for-klipper + Duet Web Control, Moonraker + Mainsail, OctoPrint
|
||||
- **Update:** Klipper Firmware, dwc2-for-klipper + Duet Web Control, Moonraker + Mainsail
|
||||
- **Backup:** Klipper Firmware, dwc2-for-klipper + Duet Web Control, Moonraker + Mainsail, OctoPrint
|
||||
@@ -50,10 +51,11 @@ chmod +x ~/kiauh/scripts/*
|
||||
- Before writing to an existing printer.cfg the script will create a backup! (better safe than sorry!)
|
||||
|
||||
### Features:
|
||||
|
||||
- Automatic dependency check:
|
||||
- If packages are missing on your machine but needed for the asked task, the script will automatically install them
|
||||
- Switch between Klipper Forks:
|
||||
- origin/master, scurve-shaping, scurve-smoothing, moonraker, dev-moonraker
|
||||
- [origin/master](https://github.com/KevinOConnor/klipper/tree/master), [scurve-shaping](https://github.com/dmbutyugin/klipper/tree/scurve-shaping), [scurve-smoothing](https://github.com/dmbutyugin/klipper/tree/scurve-smoothing), [moonraker](https://github.com/Arksine/klipper/tree/dev-moonraker-testing)
|
||||
- The update function of the script will always update the currently selected/active fork!
|
||||
- Toggle auto-create backups before updating:
|
||||
- When enabled, a backup of the installation you want to update is made prior updating
|
||||
@@ -65,9 +67,10 @@ chmod +x ~/kiauh/scripts/*
|
||||
- Enable/Disable OctoPrint Service:
|
||||
- Usefull when using DWC2/Mainsail and OctoPrint at the same time to prevent them interfering with each other
|
||||
- Set up reverse proxy for DWC2, Mainsail and OctoPrint and changing the hostname:
|
||||
|
||||
- The script can install and configure Nginx for the selected webinterface. This will allow you to make your webinterface reachable over an URL like `<hostname>.local`
|
||||
- Example: If you name the host "mainsail" and set up a reverse proxy, type `mainsail.local` in your webbrowser to open the Mainsail webinterface
|
||||
|
||||
- Example: If you name the host "mainsail" and set up a reverse proxy, type `mainsail.local` in your webbrowser to open the Mainsail webinterface
|
||||
|
||||
tbc ...
|
||||
|
||||
## What this script can't do:
|
||||
|
||||
13
kiauh.sh
13
kiauh.sh
@@ -44,6 +44,8 @@ TORNADO_DIR1=${HOME}/klippy-env/lib/python2.7/site-packages/tornado
|
||||
TORNADO_DIR2=${HOME}/klippy-env/lib/python2.7/site-packages/tornado-5.1.1.dist-info
|
||||
#mainsail/moonraker
|
||||
MAINSAIL_DIR=${HOME}/mainsail
|
||||
MOONRAKER_DIR=${HOME}/moonraker
|
||||
MOONRAKER_ENV_DIR=${HOME}/moonraker-env
|
||||
MOONRAKER_SERVICE1=/etc/init.d/moonraker
|
||||
MOONRAKER_SERVICE2=/etc/default/moonraker
|
||||
#octoprint
|
||||
@@ -61,9 +63,9 @@ KLIPPER_REPO=https://github.com/KevinOConnor/klipper.git
|
||||
ARKSINE_REPO=https://github.com/Arksine/klipper.git
|
||||
DMBUTYUGIN_REPO=https://github.com/dmbutyugin/klipper.git
|
||||
DWC2FK_REPO=https://github.com/Stephan3/dwc2-for-klipper.git
|
||||
MOONRAKER_REPO=https://github.com/Arksine/moonraker.git
|
||||
#branches
|
||||
BRANCH_MOONRAKER=Arksine/work-web_server-20200131
|
||||
BRANCH_DEV_MOONRAKER=Arksine/dev-moonraker-testing
|
||||
BRANCH_MOONRAKER=Arksine/dev-moonraker-testing
|
||||
BRANCH_SCURVE_SMOOTHING=dmbutyugin/scurve-smoothing
|
||||
BRANCH_SCURVE_SHAPING=dmbutyugin/scurve-shaping
|
||||
|
||||
@@ -427,13 +429,6 @@ switch_menu(){
|
||||
read_branch
|
||||
print_msg && clear_msg
|
||||
switch_ui;;
|
||||
5)
|
||||
clear
|
||||
print_header
|
||||
switch_to_dev_moonraker
|
||||
read_branch
|
||||
print_msg && clear_msg
|
||||
switch_ui;;
|
||||
Q|q)
|
||||
clear; advanced_menu; break;;
|
||||
*)
|
||||
|
||||
@@ -26,11 +26,15 @@ mainsail_install_routine(){
|
||||
|
||||
install_moonraker(){
|
||||
cd $KLIPPER_DIR
|
||||
if [[ $(git describe --all) = "remotes/Arksine/work-web_server-20200131" || $(git describe --all) = "remotes/Arksine/dev-moonraker-testing" ]]; then
|
||||
if [[ $(git describe --all) = "remotes/Arksine/dev-moonraker-testing" ]]; then
|
||||
dep=(wget curl unzip)
|
||||
dependency_check
|
||||
status_msg "Downloading Moonraker ..."
|
||||
cd ${HOME} && git clone $MOONRAKER_REPO
|
||||
ok_msg "Download complete!"
|
||||
status_msg "Installing Moonraker ..."
|
||||
$KLIPPER_DIR/scripts/install-moonraker.sh && ok_msg "Moonraker successfully installed!"
|
||||
$MOONRAKER_DIR/scripts/install-moonraker.sh && ok_msg "Moonraker successfully installed!"
|
||||
#create sdcard folder if it doesn't exists yet
|
||||
if [ ! -d ${HOME}/sdcard ]; then
|
||||
mkdir ${HOME}/sdcard
|
||||
fi
|
||||
@@ -40,7 +44,7 @@ install_moonraker(){
|
||||
ln -s /tmp/moonraker.log ${HOME}/moonraker.log && ok_msg "Symlink created!"
|
||||
fi
|
||||
else
|
||||
ERROR_MSG=" You are not using a Moonraker fork\n Please switch to a Moonraker fork first! Aborting ..."
|
||||
ERROR_MSG=" You are not using the Moonraker fork\n Please switch to the Moonraker fork first! Aborting ..."
|
||||
ERROR=1
|
||||
fi
|
||||
}
|
||||
@@ -86,20 +90,20 @@ VSDCARD
|
||||
}
|
||||
|
||||
check_api_section(){
|
||||
status_msg "Checking for api_server configuration ..."
|
||||
status_msg "Checking for moonraker configuration ..."
|
||||
# check if api server is present in printer.cfg
|
||||
if [ $(grep '^\[api_server\]$' $PRINTER_CFG) ]; then
|
||||
ok_msg "API Server already configured"
|
||||
if [ $(grep '^\[moonraker\]$' $PRINTER_CFG) ]; then
|
||||
ok_msg "Moonraker already configured"
|
||||
else
|
||||
status_msg "No API Server entry found."
|
||||
ok_msg "API server entry added to printer.cfg!"
|
||||
status_msg "No Moonraker entry found."
|
||||
ok_msg "Moonraker entry added to printer.cfg!"
|
||||
# append the following lines to printer.cfg
|
||||
cat <<API >> $PRINTER_CFG
|
||||
|
||||
##########################
|
||||
### CREATED WITH KIAUH ###
|
||||
##########################
|
||||
[api_server]
|
||||
[moonraker]
|
||||
trusted_clients:
|
||||
192.168.0.0/24
|
||||
192.168.1.0/24
|
||||
@@ -119,7 +123,7 @@ cat <<DEFAULT_CFG >> $PRINTER_CFG
|
||||
[virtual_sdcard]
|
||||
path: ~/sdcard
|
||||
|
||||
[api_server]
|
||||
[moonraker]
|
||||
trusted_clients:
|
||||
192.168.0.0/24
|
||||
192.168.1.0/24
|
||||
@@ -223,12 +227,12 @@ test_nginx(){
|
||||
}
|
||||
|
||||
get_mainsail_ver(){
|
||||
MAINSAIL_VERSION=`curl -s https://api.github.com/repositories/240875926/tags | grep name | cut -d'"' -f4 | cut -d"v" -f2 | head -1`
|
||||
MAINSAIL_VERSION=$(curl -s https://api.github.com/repositories/240875926/tags | grep name | cut -d'"' -f4 | cut -d"v" -f2 | head -1)
|
||||
}
|
||||
|
||||
mainsail_dl_url(){
|
||||
get_mainsail_ver
|
||||
MAINSAIL_URL=https://github.com/meteyou/mainsail/releases/download/v"$MAINSAIL_VERSION"/mainsail-alpha-"$MAINSAIL_VERSION".zip
|
||||
MAINSAIL_URL=https://github.com/meteyou/mainsail/releases/download/v"$MAINSAIL_VERSION"/mainsail-beta-"$MAINSAIL_VERSION".zip
|
||||
}
|
||||
|
||||
install_mainsail(){
|
||||
|
||||
@@ -69,10 +69,11 @@ remove_mainsail(){
|
||||
$MOONRAKER_SERVICE1
|
||||
$MOONRAKER_SERVICE2
|
||||
$MAINSAIL_DIR
|
||||
$MOONRAKER_DIR
|
||||
$MOONRAKER_ENV_DIR
|
||||
${HOME}/moonraker.log
|
||||
${HOME}/.klippy_api_key
|
||||
${HOME}/.moonraker_api_key
|
||||
${HOME}/moonraker-env
|
||||
/etc/nginx/sites-available/mainsail
|
||||
/etc/nginx/sites-enabled/mainsail
|
||||
)
|
||||
@@ -90,15 +91,15 @@ remove_mainsail(){
|
||||
status_msg "Removing Mainsail directory ..."
|
||||
rm -rf $MAINSAIL_DIR && ok_msg "Directory removed!"
|
||||
fi
|
||||
#remove moonraker-env
|
||||
if [ -d ${HOME}/moonraker-env ]; then
|
||||
status_msg "Removing Moonraker virtualenv ..."
|
||||
rm -rf ${HOME}/moonraker-env && ok_msg "Directory removed!"
|
||||
#remove moonraker and moonraker-env dir
|
||||
if [[ -d $MOONRAKER_DIR || -d $MOONRAKER_ENV_DIR ]]; then
|
||||
status_msg "Removing Moonraker and moonraker-env directory ..."
|
||||
rm -rf $MOONRAKER_DIR $MOONRAKER_ENV_DIR && ok_msg "Directories removed!"
|
||||
fi
|
||||
#remove moonraker.log symlink
|
||||
#remove moonraker.log and symlink
|
||||
if [[ -L ${HOME}/moonraker.log || -e /tmp/moonraker.log ]]; then
|
||||
status_msg "Removing moonraker.log Symlink ..."
|
||||
rm -rf ${HOME}/moonraker.log /tmp/moonraker.log && ok_msg "Symlink removed!"
|
||||
status_msg "Removing moonraker.log and Symlink ..."
|
||||
rm -rf ${HOME}/moonraker.log /tmp/moonraker.log && ok_msg "Files removed!"
|
||||
fi
|
||||
#remove mainsail cfg
|
||||
if [ -e /etc/nginx/sites-available/mainsail ]; then
|
||||
|
||||
@@ -133,10 +133,8 @@ print_branch(){
|
||||
PRINT_BRANCH="scurve-shaping "
|
||||
elif [ "$GET_BRANCH" == "dmbutyugin/scurve-smoothing" ]; then
|
||||
PRINT_BRANCH="scurve-smoothing "
|
||||
elif [ "$GET_BRANCH" == "Arksine/work-web_server-20200131" ]; then
|
||||
PRINT_BRANCH="moonraker "
|
||||
elif [ "$GET_BRANCH" == "Arksine/dev-moonraker-testing" ]; then
|
||||
PRINT_BRANCH="dev-moonraker "
|
||||
PRINT_BRANCH="moonraker "
|
||||
else
|
||||
PRINT_BRANCH="${red}----${default} "
|
||||
fi
|
||||
|
||||
@@ -29,13 +29,4 @@ switch_to_moonraker(){
|
||||
git remote add Arksine $ARKSINE_REPO
|
||||
fi
|
||||
git fetch Arksine -q && git checkout $BRANCH_MOONRAKER -q
|
||||
}
|
||||
|
||||
switch_to_dev_moonraker(){
|
||||
cd $KLIPPER_DIR
|
||||
status_msg "Switching...Please wait ..."; echo
|
||||
if ! git remote | grep Arksine -q; then
|
||||
git remote add Arksine $ARKSINE_REPO
|
||||
fi
|
||||
git fetch Arksine -q && git checkout $BRANCH_DEV_MOONRAKER -q
|
||||
}
|
||||
@@ -153,7 +153,6 @@ switch_ui(){
|
||||
echo -e "| 3) [--> scurve-smoothing] | "
|
||||
echo -e "| | "
|
||||
echo -e "| 4) [--> moonraker] | "
|
||||
echo -e "| 5) [--> dev-moonraker] | "
|
||||
quit_footer
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user