This commit is contained in:
paukstelis
2022-05-27 16:37:15 -04:00
parent b096cbf1b1
commit 7124797533

View File

@@ -264,6 +264,8 @@ new_instance () {
cat $BFOLD/config.yaml | sed -e "s/INSTANCE/$INSTANCE/" > $OCTOCONFIG/.$INSTANCE/config.yaml cat $BFOLD/config.yaml | sed -e "s/INSTANCE/$INSTANCE/" > $OCTOCONFIG/.$INSTANCE/config.yaml
#uniquify instances #uniquify instances
sed -i "s/upnpUuid: .*/upnpUuid: $(uuidgen)/" $OCTOCONFIG/.$INSTANCE/config.yaml sed -i "s/upnpUuid: .*/upnpUuid: $(uuidgen)/" $OCTOCONFIG/.$INSTANCE/config.yaml
#Set port
sed -i "/serial:/a\ port: /dev/octo_$INSTANCE" $OCTOCONFIG/.$INSTANCE/config.yaml
if [[ -n $CAM || -n $USBCAM ]]; then if [[ -n $CAM || -n $USBCAM ]]; then
write_camera write_camera
@@ -606,6 +608,7 @@ prepare () {
usermod -a -G dialout,video $user usermod -a -G dialout,video $user
#service start/stop may fail on non-OctoPi instances, but that is probably Ok #service start/stop may fail on non-OctoPi instances, but that is probably Ok
if [ -f "/home/$user/.octoprint/config.yaml" ]; then
if grep -q 'firstRun: false' /home/$user/.octoprint/config.yaml; then if grep -q 'firstRun: false' /home/$user/.octoprint/config.yaml; then
echo "It looks as though this installation has already been in use." | log echo "It looks as though this installation has already been in use." | log
echo "In order to use the script, the files must be moved." echo "In order to use the script, the files must be moved."
@@ -622,6 +625,7 @@ prepare () {
main_menu main_menu
fi fi
fi fi
fi
if [ $INSTALL -eq 1 ]; then if [ $INSTALL -eq 1 ]; then
echo 'type: octopi' >> /etc/octoprint_deploy echo 'type: octopi' >> /etc/octoprint_deploy
@@ -649,6 +653,7 @@ prepare () {
echo 'Modifying config.yaml' echo 'Modifying config.yaml'
cp -p $SCRIPTDIR/config.basic /home/pi/.octoprint/config.yaml cp -p $SCRIPTDIR/config.basic /home/pi/.octoprint/config.yaml
echo 'Connect to your octoprint (octopi.local) instance and setup admin user' echo 'Connect to your octoprint (octopi.local) instance and setup admin user'
systemctl restart octoprint.service
fi fi
@@ -753,7 +758,7 @@ prepare () {
sudo -u $user make -C ustreamer > /dev/null sudo -u $user make -C ustreamer > /dev/null
fi fi
if [ $VID -eq 3]; then if [ $VID -eq 3 ]; then
echo "You can install a streamer manually at a later time." echo "You can install a streamer manually at a later time."
fi fi
@@ -778,6 +783,9 @@ prepare () {
echo 'Connect to your template instance and setup the admin user.' echo 'Connect to your template instance and setup the admin user.'
systemctl start octoprint_default.service systemctl start octoprint_default.service
systemctl enable octoprint_default.service systemctl enable octoprint_default.service
echo
echo
systemctl restart octoprint_default.service
fi fi
fi fi