update.sh 1.0 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. CONFIG_FILE="instance/config.py"
  3. NEW_VARIABLES="\
  4. 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
  5. INDIEAUTH_CLIENT_SECRET = '' # The access token you created for INDIEAUTH_CLIENT_ID
  6. "
  7. # Create a temporary file
  8. TEMP_FILE=$(mktemp)
  9. # Read through the original config file and output to the temp file
  10. while IFS= read -r line
  11. do
  12. echo "$line" >> "$TEMP_FILE"
  13. # Check for the section marker and insert new lines after it
  14. if [[ "$line" == "# Owncast stuff. Needed to interact with your Owncast instance" ]]; then
  15. echo "$NEW_VARIABLES" >> "$TEMP_FILE"
  16. fi
  17. done < "$CONFIG_FILE"
  18. # Replace the original config file with the updated temp file
  19. mv "$TEMP_FILE" "$CONFIG_FILE"
  20. echo "Config file updated."
  21. echo "Create a new access token in your Owncast Admin panel -> Integrations -> Access Tokens."
  22. echo "Enter the new name and token into the new variables in $CONFIG_FILE."