Files
octodocker_deploy/octoprint_deploy.sh
paukstelis 8d57a478be Rework (#94)
* split

* split2

* more splitting

* working

* towards working

* menu changes

* run through prepare

* minorfix

* octoprint_generic

* break in template

* replace daemonpath with octoexec

* move first install to instance

* move BASE to instance

* instance fix

* double period

* damn loop!

* add camera to deploy

* fix camera

* toward functional

* main_menu if not ready

* not equal or  -ne?

* template copy

* clean ups

* byid camera detect

* do byid detect by default

* classwebcam

* classicwebcam

* appned_value camera work

* use users for modification in cameras

* fancy colors

* updating colors

* status menu colors and cams

* surpress errors on no files

* remove most logging

* dnf mods

* selinux

* redirect error output to /dev/null

* package cleanup

* remove udev, cloud

* octopi update

* resource prepare from menu

* quick fix

* pacman fix

* more echos

* add udev flag in /etc/octoprint_deploy

* opensuse fixes

* zypper, minor fixes

* change_streamer

* diagnostics, octoprint_cameras, etc

* diagnostic menu

* logging for diagnostics

* add config.yaml to diagnostics

* add logging for config.yaml

* readme work, add deb_pacakges for octopi,

* README

* port fixing

* port fixes

* add deb_packages command for troubleshooting

* fix ports

* add octopi flag, I fucking hate octopi

* udev rule work

* add/remove udev

* menu fix

* menu fixes

* add detect printer for add_udev

* better detection for remove_udev

* remove udev

* working on sed for udev

* fixed udev remove

* camera udev

* add instace to add_udev_camera

* readme, cleanup

* choose what parts of template to copy

* rsync as user

* additionalPorts

* remove cameras from camera list
2023-06-25 17:09:01 -04:00

59 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
#all operations must be with root/sudo
if (( $EUID != 0 )); then
echo "Please run with sudo"
exit
fi
#this is a weak check, but will catch most cases
if [ $SUDO_USER ]; then
user=$SUDO_USER
else
echo "You should not run this script as root. Use sudo as a normal user"
exit
fi
if [ "$user" == root ]; then
echo "You should not run this script as root. Use sudo as a normal user"
exit
fi
# initiate logging
logfile='octoprint_deploy.log'
SCRIPTDIR=$(dirname $(readlink -f $0))
source $SCRIPTDIR/plugins.sh
source $SCRIPTDIR/prepare.sh
source $SCRIPTDIR/instance.sh
source $SCRIPTDIR/util.sh
source $SCRIPTDIR/menu.sh
source $SCRIPTDIR/cameras.sh
get_settings
#command line arguments
if [ "$1" == remove ]; then
remove_everything
fi
if [ "$1" == restart_all ]; then
restart_all
fi
if [ "$1" == backup ]; then
back_up_all
fi
if [ "$1" == picam ]; then
add_camera true
fi
if [ "$1" == noserial ]; then
NOSERIAL=1
fi
if [ "$1" == deb_packages ]; then
deb_packages
fi
main_menu