#!/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 -e "Config file updated.\n" echo -e "***IMPORTANT***\n" echo -e "Create a new access token in your Owncast Admin panel -> Integrations -> Access Tokens." echo -e "Enter the new name and token into the new variables in $CONFIG_FILE.\n" echo "The way you access your OwnchatBot management panel has changed. Authentication is now handled using your Owncast server as an IndieAuth server. You log in using the same credentials you use to log in to your Owncast Admin page."