#!/bin/bash CONFIG_FILE="instance/config.py" NEW_VARIABLES="\ INDIEAUTH_CLIENT_ID = '' # Create a new access token at Owncast Admin panel -> Integrations -> Access Tokens, this variable is the name you associate with that token INDIEAUTH_CLIENT_SECRET = '' # The access token you created for INDIEAUTH_CLIENT_ID " # Create a temporary file TEMP_FILE=$(mktemp) # Read through the original config file and output to the temp file while IFS= read -r line do echo "$line" >> "$TEMP_FILE" # Check for the section marker and insert new lines after it if [[ "$line" == "# Owncast stuff. Needed to interact with your Owncast instance" ]]; then echo "$NEW_VARIABLES" >> "$TEMP_FILE" fi done < "$CONFIG_FILE" # Replace the original config file with the updated temp file mv "$TEMP_FILE" "$CONFIG_FILE" echo "Config file updated." echo "Create a new access token in your Owncast Admin panel -> Integrations -> Access Tokens." echo "Enter the new name and token into the new variables in $CONFIG_FILE."