From 5a7cde9a0062e598a39286a63132d441318491d0 Mon Sep 17 00:00:00 2001 From: paukstelis Date: Tue, 18 Jul 2023 16:55:27 -0400 Subject: [PATCH] Development (#105) * clean up with some redirects * plugins from user, get better camera info * readme, version --- README.md | 4 ++-- cameras.sh | 4 ++-- instance.sh | 2 +- menu.sh | 2 +- plugins.sh | 2 +- util.sh | 28 +++++++++++++++------------- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index cf5b44e..e5fcf54 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -Updated July 1, 2023. +Updated July 18, 2023. Want to support this work? Buy Me a Coffee. https://www.buymeacoffee.com/ppaukstelis. Need help with octoprint_deploy? Ask on Discord: https://discord.gg/6vgSjgvR6u -# octoprint_deploy 1.0.3 - ALL NEW +# octoprint_deploy 1.0.4 - ALL NEW * These files provide a bash script for quickly deploying multiple octoprint instances on a single computer. For Linux systems (Ubuntu, Fedora, etc.) it will also install OctoPrint and a video streamer (ustreamer). No need for lots of file editing or complicated Docker compose scripts! A background video on how it generally works from my ERRF2022 talk can be found here: https://www.youtube.com/watch?v=q0iCNl8-kJI&t=15378s * octoprint_deploy and octoprint_install are being merged! Maintaining two separate scripts was close to twice the amount of work. By merging the scripts many new features have been included, while also providing greater simplicity in setup. For now, the merged script will be called octoprint_deploy and at some point the octoprint_install repository will point here. diff --git a/cameras.sh b/cameras.sh index f1d142f..d11431a 100755 --- a/cameras.sh +++ b/cameras.sh @@ -29,9 +29,9 @@ detect_camera() { } remove_camera() { - systemctl stop $1.service + systemctl stop $1.service systemctl disable $1.service - rm /etc/systemd/system/$1.service + rm /etc/systemd/system/$1.service 2>/dev/null sed -i "/$1/d" /etc/udev/rules.d/99-octoprint.rules sed -i "/$1/d" /etc/octoprint_cameras if [ "$HAPROXY" == true ]; then diff --git a/instance.sh b/instance.sh index 811a775..11f7c6c 100644 --- a/instance.sh +++ b/instance.sh @@ -320,7 +320,7 @@ remove_instance() { if [ -f /etc/systemd/system/$opt.service ]; then systemctl stop $opt.service systemctl disable $opt.service - rm /etc/systemd/system/$opt.service + rm /etc/systemd/system/$opt.service 2>/dev/null fi #Get all cameras associated with this instance. diff --git a/menu.sh b/menu.sh index 9979469..0d89d42 100644 --- a/menu.sh +++ b/menu.sh @@ -8,7 +8,7 @@ cyan=$(echo -en "\e[96m") yellow=$(echo -en "\e[93m") main_menu() { - VERSION=1.0.3 + VERSION=1.0.4 #reset UDEV='' TEMPUSB='' diff --git a/plugins.sh b/plugins.sh index fe555ee..d66c5d7 100755 --- a/plugins.sh +++ b/plugins.sh @@ -2,7 +2,7 @@ install_plugin() { echo "Installing $plugin...." - $OCTOPIP install "$plugin_path" + sudo -u $user $OCTOPIP install "$plugin_path" } plugin_menu() { diff --git a/util.sh b/util.sh index 090bd4f..dda72c1 100644 --- a/util.sh +++ b/util.sh @@ -315,18 +315,19 @@ remove_everything() { done echo "Removing system stuff" - rm /etc/systemd/system/octoprint.service - rm /etc/octoprint_streamer - rm /etc/octoprint_deploy - rm /etc/octoprint_instances - rm /etc/octoprint_cameras - rm /etc/udev/rules.d/99-octoprint.rules - rm /etc/sudoers.d/octoprint_reboot - rm /etc/sudoers.d/octoprint_systemctl - rm -rf /home/$user/.octoprint - rm -rf /home/$user/OctoPrint - rm -rf /home/$user/ustreamer - rm -rf /home/$user/mjpg-streamer + rm /etc/systemd/system/octoprint.service 2>/dev/null + rm /etc/octoprint_streamer 2>/dev/null + rm /etc/octoprint_deploy 2>/dev/null + rm /etc/octoprint_instances 2>/dev/null + rm /etc/octoprint_cameras 2>/dev/null + rm /etc/udev/rules.d/99-octoprint.rules 2>/dev/null + rm /etc/sudoers.d/octoprint_reboot 2>/dev/null + rm /etc/sudoers.d/octoprint_systemctl 2>/dev/null + rm -rf /home/$user/.octoprint 2>/dev/null + rm -rf /home/$user/OctoPrint 2>/dev/null + rm -rf /home/$user/ustreamer 2>/dev/null + rm -rf /home/$user/mjpg-streamer 2>/dev/null + rm -rf /home/$user/camera-streamer 2>/dev/null systemctl restart haproxy.service systemctl daemon-reload @@ -387,7 +388,8 @@ diagnostics() { echo "**************************************" | log systemctl status $instance -l --no-pager | log #get needed config info - sudo -u $user $OCTOEXEC --basedir=/home/$user/.$INSTANCE config get plugins.classicwebcam | log + sudo -u $user $OCTOEXEC --basedir=/home/$user/.$INSTANCE config get plugins.classicwebcam.stream | log + sudo -u $user $OCTOEXEC --basedir=/home/$user/.$INSTANCE config get plugins.classicwebcam.snapshot | log sudo -u $user $OCTOEXEC --basedir=/home/$user/.$INSTANCE config get webcam | log done #get all cam status