|
@@ -5,8 +5,11 @@ set -e # Exit immediately if any command exits with a non-zero status
|
|
|
update_config() {
|
|
update_config() {
|
|
|
CONFIG_FILE="instance/config.py"
|
|
CONFIG_FILE="instance/config.py"
|
|
|
|
|
|
|
|
|
|
+ # Prompt the user for the Owncast instance URL
|
|
|
|
|
+ read -p "Enter the name of the existing Owncast access token used by OwnchatBot: " TOKEN_NAME
|
|
|
|
|
+
|
|
|
NEW_VARIABLES="\
|
|
NEW_VARIABLES="\
|
|
|
-ACCESS_ID = '' # The name of your access token
|
|
|
|
|
|
|
+ACCESS_ID = '$TOKEN_NAME' # The name of your access token
|
|
|
FOLLOW_POINTS = '50' # How many points to award viewers for following
|
|
FOLLOW_POINTS = '50' # How many points to award viewers for following
|
|
|
"
|
|
"
|
|
|
|
|
|
|
@@ -23,14 +26,18 @@ FOLLOW_POINTS = '50' # How many points to award viewers for following
|
|
|
|
|
|
|
|
echo "$NEW_VARIABLES" >> "$TEMP_FILE" || { echo "Error writing new variables to temp file"; exit 1; } # Append new variables to the temp file
|
|
echo "$NEW_VARIABLES" >> "$TEMP_FILE" || { echo "Error writing new variables to temp file"; exit 1; } # Append new variables to the temp file
|
|
|
|
|
|
|
|
- mv "$TEMP_FILE" "$CONFIG_FILE" || { echo "Error replacing the original config file"; exit 1; } # Move the temp file to the config file
|
|
|
|
|
|
|
+ mv "$TEMP_FILE" "$CONFIG_FILE" || { echo "Error replacing the original config file"; exit 1; } # Move the temp file to the config file
|
|
|
|
|
|
|
|
echo "Config file updated successfully."
|
|
echo "Config file updated successfully."
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
activate_venv() {
|
|
activate_venv() {
|
|
|
source env/bin/activate || { echo "Failed to activate virtual environment"; exit 1; }
|
|
source env/bin/activate || { echo "Failed to activate virtual environment"; exit 1; }
|
|
|
- pip install pkce || { echo "Failed to install pkce module"; exit 1; }
|
|
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+install_module() {
|
|
|
|
|
+ pip install --upgrade pip
|
|
|
|
|
+ pip install pkce || { echo "Failed to install pkce module"; exit 1; } # Install pkce module
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
update_db() { # Create the database. This also populates it with some goals and votes from the default rewards.py
|
|
update_db() { # Create the database. This also populates it with some goals and votes from the default rewards.py
|
|
@@ -45,9 +52,10 @@ update_db() { # Create the database. This also populates it with some goals and
|
|
|
|
|
|
|
|
update_config
|
|
update_config
|
|
|
activate_venv
|
|
activate_venv
|
|
|
|
|
+install_module
|
|
|
update_db
|
|
update_db
|
|
|
deactivate
|
|
deactivate
|
|
|
|
|
|
|
|
echo -e "***IMPORTANT***\n"
|
|
echo -e "***IMPORTANT***\n"
|
|
|
-echo -e "Look for new \"Access Token Name\" option in the Settings menu of your OwnchatBot managemment panel.\n"
|
|
|
|
|
|
|
+echo -e "Look for new \"Access Token Name\" option in the Settings menu of your OwnchatBot management panel.\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."
|
|
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."
|