From f863c23a987003f6a9aaf47aae1696b9a694705d Mon Sep 17 00:00:00 2001 From: paukstelis Date: Fri, 29 Jul 2022 09:48:15 -0400 Subject: [PATCH] 0.1.2 write /etc/octoprint_deploy if missing --- README.md | 2 ++ octoprint_deploy.sh | 30 +++++++++++++++++++++++++++--- plugins_list | 2 +- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 56279c0..d32f27f 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ These files provide a simple bash script for quickly deploying multiple octoprin * Please note, haproxy entries are NOT used for webcams once you use this system. Connect to them via hostname:port. * General Linux (Ubuntu/Mint/RPiOS/Debian/Fedora/Arch/etc.) * __You do not need to install OctoPrint using any Wiki instructions, snap, etc. The script will do it for you.__ + * octoprint_deploy uses systemd services, so avoid distros that do not use systemd by default (MX Linux) * Basic guide video here: https://youtu.be/1YINWQ5fNn0 * All commands assume you are operating out of your home directory. * Install Ubuntu 18-22.X, Mint 20.3+, Debian, DietPi, RPiOS, Armbian, Fedora35+, or ArchLinux on your system (make sure your user is admin for sudo). @@ -53,6 +54,7 @@ These files provide a simple bash script for quickly deploying multiple octoprin * Restart all non-template instances from the command line: `sudo octoprint_deploy/octoprint_deploy.sh restart_all` * Change udev rules for an instance with `sudo octoprint_deploy/octoprint_deploy.sh replace` # Recent Changes +* Write /etc/octoprint_deploy if missing (older version system preparation) * Add option for plugin installation during system preparation. * Enable ssh. * Added webcam restart to system commands during camera addition. diff --git a/octoprint_deploy.sh b/octoprint_deploy.sh index cbe0637..35f3bb1 100755 --- a/octoprint_deploy.sh +++ b/octoprint_deploy.sh @@ -909,9 +909,9 @@ firstrun() { fi if prompt_confirm "Enable anonymous usage tracking?"; then - $OCTOEXEC config set plugins.tracking.enabled true -bool + $OCTOEXEC config set plugins.tracking.enabled true --bool else - $OCTOEXEC config set plugins.tracking.enabled false -bool + $OCTOEXEC config set plugins.tracking.enabled false --bool fi if prompt_confirm "Use default printer (can be changed later)?"; then @@ -1080,7 +1080,7 @@ replace_id() { } main_menu() { - VERSION=0.1.1 + VERSION=0.1.2 #reset UDEV='' TEMPUSB='' @@ -1143,6 +1143,30 @@ if [ $SUDO_USER ]; then user=$SUDO_USER; fi logfile='octoprint_deploy.log' SCRIPTDIR=$(dirname $(readlink -f $0)) source $SCRIPTDIR/plugins.sh +# gather info and write /etc/octoprint_deploy if missing +if [ ! -f /etc/octoprint_deploy ] && [ -f /etc/octoprint_instances ]; then + echo "/etc/octoprint_deploy is missing. You may have prepared the system with an older vesion." + echo "The file will be created now." + streamer_type=("mjpg-streamer" "ustreamer") + haproxy_bool=("true" "false") + if [ -f /etc/octopi_version ]; then + echo "type: octopi" >> /etc/octoprint_deploy + apt-get -y install uuid-runtime + else + echo "type: linux" >> /etc/octoprint_deploy + fi + PS3='Select streamer type: ' + select str in "${streamer_type[@]}"; do + echo "streamer: $str" >> /etc/octoprint_deploy + break + done + PS3='Using haproxy (select true if using octopi): ' + select prox in "${haproxy_bool[@]}"; do + echo "haproxy: $prox" >> /etc/octoprint_deploy + break + done + +fi #command line arguments if [ "$1" == remove ]; then diff --git a/plugins_list b/plugins_list index b021b0f..07111af 100644 --- a/plugins_list +++ b/plugins_list @@ -4,4 +4,4 @@ plugin:Firmware Updater path:https://github.com/OctoPrint/OctoPrint-FirmwareUpda plugin:Terminal Commands Extended: path:https://github.com/jneilliii/OctoPrint-TerminalCommandsExtended/archive/master.zip plugin:Active Filters Extended path:https://github.com/jneilliii/OctoPrint-ActiveFiltersExtended/archive/master.zip plugin:PrintTimeGenius path:https://github.com/eyal0/OctoPrint-PrintTimeGenius/archive/master.zip -plugin:Themify path:https://github.com/birkbjo/OctoPrint-Themeify/archive/master.zip \ No newline at end of file +plugin:UI Customizer path:https://github.com/LazeMSS/OctoPrint-UICustomizer/archive/main.zip \ No newline at end of file