diff --git a/workspace/scripts/files/bash/firstboot_leader.sh b/workspace/scripts/files/bash/firstboot_leader.sh index 83708dd..15e6b7c 100644 --- a/workspace/scripts/files/bash/firstboot_leader.sh +++ b/workspace/scripts/files/bash/firstboot_leader.sh @@ -28,9 +28,10 @@ sqlite3 $DB_LOC "INSERT OR IGNORE INTO experiments (created_at, experiment, desc # create leader's config file (still can use one even if not a worker.) -sudo -u $USERNAME touch $PIO_DIR/config_"$HOSTNAME".ini # set with the correct read/write permissions -printf '# Any settings here are specific to %s, and override the settings in config.ini\n\n' "$HOSTNAME" >> $PIO_DIR/config_"$HOSTNAME".ini +sudo -u $USERNAME touch "$PIO_DIR/config_$HOSTNAME.ini" # set with the correct read/write permissions +printf '# Any settings here are specific to %s, the leader, and override the settings in config.ini\n\n' "$HOSTNAME" >> "$PIO_DIR/config_$HOSTNAME.ini" -crudini --ini-options=nospace --set $PIO_DIR/config_"$HOSTNAME".ini cluster.topology leader_address 127.0.0.1 \ - --set $PIO_DIR/config_"$HOSTNAME".ini mqtt broker_address 127.0.0.1 +crudini --ini-options=nospace --set "$PIO_DIR/config_$HOSTNAME.ini" cluster.topology leader_address 127.0.0.1 \ + --set "$PIO_DIR/config_$HOSTNAME.ini" mqtt broker_address 127.0.0.1 +cp "$PIO_DIR/config_$HOSTNAME.ini" "$PIO_DIR/unit_config.ini" \ No newline at end of file diff --git a/workspace/scripts/files/bash/firstboot_leader_and_worker.sh b/workspace/scripts/files/bash/firstboot_leader_and_worker.sh index 908f339..5d98cc9 100644 --- a/workspace/scripts/files/bash/firstboot_leader_and_worker.sh +++ b/workspace/scripts/files/bash/firstboot_leader_and_worker.sh @@ -31,7 +31,7 @@ sqlite3 "$DB_LOC" "INSERT OR IGNORE INTO experiment_worker_assignments (pioreact # create our config file. sudo -u $USERNAME touch $PIO_DIR/config_"$HOSTNAME".ini # set with the correct read/write permissions -printf '# Any settings here are specific to %s, and override the settings in config.ini\n\n' "$HOSTNAME" >> $PIO_DIR/config_"$HOSTNAME".ini +printf '# Any settings here are specific to %s, the leader, and override the settings in config.ini\n\n' "$HOSTNAME" >> $PIO_DIR/config_"$HOSTNAME".ini crudini --ini-options=nospace --set $PIO_DIR/config_"$HOSTNAME".ini cluster.topology leader_address 127.0.0.1 \ --set $PIO_DIR/config_"$HOSTNAME".ini mqtt broker_address 127.0.0.1 \ diff --git a/workspace/scripts/files/bash/update_ui.sh b/workspace/scripts/files/bash/update_ui.sh index 30bee2e..0ee4c05 100644 --- a/workspace/scripts/files/bash/update_ui.sh +++ b/workspace/scripts/files/bash/update_ui.sh @@ -31,7 +31,13 @@ fi # copy data over # use rsync because we want to merge custom yamls the user has, we any updates to our own yamls. rsync -ap --ignore-existing $UI_FOLDER/contrib/ $WORK_DIR/contrib/ 2>/dev/null || : -cp -p $UI_FOLDER/.env $WORK_DIR 2>/dev/null || : + +if [ -f "$UI_FOLDER/.env" ]; then + echo "Copying .env file" + cp -p $UI_FOLDER/.env $WORK_DIR +else + echo ".env file does not exist in $UI_FOLDER" +fi # swap folders rm -rf $UI_FOLDER diff --git a/workspace/scripts/files/config.example.ini b/workspace/scripts/files/config.example.ini index 99fabeb..999c59a 100644 --- a/workspace/scripts/files/config.example.ini +++ b/workspace/scripts/files/config.example.ini @@ -19,14 +19,14 @@ B= C= D= -[stirring] +[stirring.config] target_rpm=500 initial_duty_cycle=30 pwm_hz=200 use_rpm=1 duration_between_updates_seconds=23 -[od_config] +[od_reading.config] # how many optical density measurements should be published per second? Recommended maximum is 1. samples_per_second=0.2