├── .gitignore ├── LICENSE ├── README.md └── octoprint_install.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Paul Paukstelis 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # octoprint_install 2 | Maintaining two scripts was a lot of work, therefore, the octoprint_install script has reached end-of-life and has now been archived. The octoprint_deploy script can now do all the things of octoprint_install and much more. The current script, if run, will prompt to clone octoprint_deploy which can be found here: https://github.com/paukstelis/octoprint_deploy -------------------------------------------------------------------------------- /octoprint_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #all operations must be with root/sudo 4 | if (($EUID != 0)); then 5 | echo "Please run with sudo" 6 | exit 7 | fi 8 | 9 | #this is a weak check, but will catch most cases 10 | if [ $SUDO_USER ]; then 11 | user=$SUDO_USER 12 | else 13 | echo "You should not run this script as root. Use sudo as a normal user" 14 | exit 15 | fi 16 | 17 | if [ "$user" == root ]; then 18 | echo "You should not run this script as root. Use sudo as a normal user" 19 | exit 20 | fi 21 | 22 | SCRIPTDIR=$(dirname $(readlink -f $0)) 23 | 24 | # from stackoverflow.com/questions/3231804 25 | prompt_confirm() { 26 | while true; do 27 | read -r -n 1 -p "${1:-Continue?} [y/n]: " REPLY 28 | case $REPLY in 29 | [yY]) 30 | echo 31 | return 0 32 | ;; 33 | [nN]) 34 | echo 35 | return 1 36 | ;; 37 | *) printf " \033[31m %s \n\033[0m" "invalid input" ;; 38 | esac 39 | done 40 | } 41 | 42 | echo "octoprint_install has reached end-of-life and has been replaced by octoprint_deploy" 43 | if prompt_confirm "Do you want to use octoprint_deploy instead?"; then 44 | sudo -u $user git clone https://github.com/paukstelis/octoprint_deploy /home/$user/octoprint_deploy 45 | echo "Cloning octoprint_deploy into /home/$user/octoprint_deploy" 46 | echo 47 | echo 48 | echo 49 | echo 50 | echo 51 | echo "To use octoprint_deploy, run the command:" 52 | echo "sudo octoprint_deploy/octoprint_deploy.sh" 53 | echo "and follow the instructions" 54 | fi 55 | --------------------------------------------------------------------------------