various housekeeping
This commit is contained in:
@@ -70,12 +70,12 @@ new_instance () {
|
|||||||
read INSTANCE
|
read INSTANCE
|
||||||
if [ -z "$INSTANCE" ]; then
|
if [ -z "$INSTANCE" ]; then
|
||||||
echo "No instance given. Exiting" | log
|
echo "No instance given. Exiting" | log
|
||||||
exit 1
|
main_menu
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -f "/etc/systemd/system/$INSTANCE.service"; then
|
if test -f "/etc/systemd/system/$INSTANCE.service"; then
|
||||||
echo "Already have an entry for $INSTANCE. Exiting." | log
|
echo "Already have an entry for $INSTANCE. Exiting." | log
|
||||||
exit 1
|
main_menu
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Port on which this instance will run (ENTER will increment from last value in /etc/octoprint_instances):"
|
echo "Port on which this instance will run (ENTER will increment from last value in /etc/octoprint_instances):"
|
||||||
@@ -116,7 +116,7 @@ new_instance () {
|
|||||||
echo "Executable path is valid" | log
|
echo "Executable path is valid" | log
|
||||||
else
|
else
|
||||||
echo "Exectuable path is not valid! Aborting" | log
|
echo "Exectuable path is not valid! Aborting" | log
|
||||||
exit 1
|
main_menu
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Octoprint Config Path (where the hidden instance directory will be) [/home/$user/]:"
|
echo "Octoprint Config Path (where the hidden instance directory will be) [/home/$user/]:"
|
||||||
@@ -136,13 +136,13 @@ new_instance () {
|
|||||||
echo "Template path is valid" | log
|
echo "Template path is valid" | log
|
||||||
else
|
else
|
||||||
echo "Template path is not valid! Aborting" | log
|
echo "Template path is not valid! Aborting" | log
|
||||||
exit 1
|
main_menu
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#check to make sure first run is complete
|
#check to make sure first run is complete
|
||||||
if grep -q 'firstRun: true' $BFOLD/config.yaml; then
|
if grep -q 'firstRun: true' $BFOLD/config.yaml; then
|
||||||
echo "WARNING!! You must setup the base profile and admin user before continuing" | log
|
echo "WARNING!! You must setup the base profile and admin user before continuing" | log
|
||||||
exit 1
|
main_menu
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if prompt_confirm "Begin auto-detect printer serial number for udev entry?"
|
if prompt_confirm "Begin auto-detect printer serial number for udev entry?"
|
||||||
@@ -178,11 +178,14 @@ new_instance () {
|
|||||||
#No serial number
|
#No serial number
|
||||||
if [ -z "$UDEV" ]; then
|
if [ -z "$UDEV" ]; then
|
||||||
echo "Printer Serial Number not detected"
|
echo "Printer Serial Number not detected"
|
||||||
prompt_confirm "Do you want to use the physical USB port to assign the udev entry? If you use this any USB hubs and printers detected this way must stay plugged into the same USB positions on your machine as they are right now" || exit 0
|
if prompt_confirm "Do you want to use the physical USB port to assign the udev entry? If you use this any USB hubs and printers detected this way must stay plugged into the same USB positions on your machine as they are right now"; then
|
||||||
echo
|
echo
|
||||||
USB=$TEMPUSB
|
USB=$TEMPUSB
|
||||||
echo -e "Your printer will be setup at the following usb address:\033[0;34m $USB\033[0m" | log
|
echo -e "Your printer will be setup at the following usb address:\033[0;34m $USB\033[0m" | log
|
||||||
echo
|
echo
|
||||||
|
else
|
||||||
|
main_menu
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo -e "Serial number detected as: \033[0;34m $UDEV\033[0m" | log
|
echo -e "Serial number detected as: \033[0;34m $UDEV\033[0m" | log
|
||||||
check_sn "$UDEV"
|
check_sn "$UDEV"
|
||||||
@@ -575,8 +578,10 @@ prepare () {
|
|||||||
echo "They will be found at /home/$user/.old-octo"
|
echo "They will be found at /home/$user/.old-octo"
|
||||||
if prompt_confirm "Continue with installation?"; then
|
if prompt_confirm "Continue with installation?"; then
|
||||||
echo "Continuing installation." | log
|
echo "Continuing installation." | log
|
||||||
|
systemctl stop octoprint.service
|
||||||
echo "Moving files to /home/$user/.old-octo" | log
|
echo "Moving files to /home/$user/.old-octo" | log
|
||||||
mv /home/$user/.octoprint /home/$user/.old-octo
|
mv /home/$user/.octoprint /home/$user/.old-octo
|
||||||
|
systemctl start octoprint.service
|
||||||
else
|
else
|
||||||
main_menu
|
main_menu
|
||||||
fi
|
fi
|
||||||
@@ -635,7 +640,9 @@ prepare () {
|
|||||||
echo 'Updating config.yaml'
|
echo 'Updating config.yaml'
|
||||||
sudo -u $user mkdir /home/$user/.octoprint
|
sudo -u $user mkdir /home/$user/.octoprint
|
||||||
sudo -u $user cp -p $SCRIPTDIR/config.basic /home/$user/.octoprint/config.yaml
|
sudo -u $user cp -p $SCRIPTDIR/config.basic /home/$user/.octoprint/config.yaml
|
||||||
|
echo
|
||||||
|
echo
|
||||||
|
echo
|
||||||
PS3='Which video streamer you would like to install?: '
|
PS3='Which video streamer you would like to install?: '
|
||||||
options=("mjpeg-streamer" "ustreamer" "None")
|
options=("mjpeg-streamer" "ustreamer" "None")
|
||||||
select opt in "${options[@]}"
|
select opt in "${options[@]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user