This commit is contained in:
2024-08-04 19:19:54 -05:00
parent fa148e0b3c
commit 78be1dff59
3 changed files with 16 additions and 16 deletions

View File

@@ -7,7 +7,7 @@ new_instance() {
USB=''
#It is possible to not create an instance after preparing,so check if this is the first
if [ -f /etc/octoprint_instances ]; then
if [ -f /etc/octodocker_instances ]; then
firstrun=false
else
firstrun=true
@@ -85,7 +85,7 @@ new_instance() {
if prompt_confirm "Ready to begin instance creation?"; then
PORT=5000
PORTS_INUSE=$(join_by , $(cat /etc/octoprint_instances 2>/dev/null | sed -n -e 's/^.*\(port:\)\(.*\) udev:.*/\2/p'))
PORTS_INUSE=$(join_by , $(cat /etc/octodocker_instances 2>/dev/null | sed -n -e 's/^.*\(port:\)\(.*\) udev:.*/\2/p'))
until [[ "${PORTS_INUSE}" != *"${PORT}"* ]]; do ((PORT++)); done
echo Selected port is: $PORT
@@ -153,9 +153,9 @@ new_instance() {
#Append instance name to list for removal tool
if [ -z "$UDEV" ] && [ -z "$USB" ]; then
echo "instance:$INSTANCE port:$PORT udev:false" >> /etc/octoprint_instances
echo "instance:$INSTANCE port:$PORT udev:false" >> /etc/octodocker_instances
else
echo "instance:$INSTANCE port:$PORT udev:true" >> /etc/octoprint_instances
echo "instance:$INSTANCE port:$PORT udev:true" >> /etc/octodocker_instances
fi
if [ -n "$TEMPLATE" ]; then
@@ -341,7 +341,7 @@ remove_instance() {
#remove files
rm -rf /opt/octoprint/s$opt
#remove from octoprint_instances
sed -i "/$opt/d" /etc/octoprint_instances
sed -i "/$opt/d" /etc/octodocker_instances
#remove haproxy entry
if [ "$HAPROXY" == true ]; then
sed -i "/use_backend $opt/d" /etc/haproxy/haproxy.cfg