Update install.sh
This commit is contained in:
parent
eb0218ace3
commit
4eb6d7e236
20
install.sh
20
install.sh
|
@ -2,21 +2,35 @@
|
||||||
|
|
||||||
# Define the URL for downloading the simple-jaeger.php file
|
# Define the URL for downloading the simple-jaeger.php file
|
||||||
PLUGIN_URL="https://git.nixc.us/colin/SimpleJaeger/raw/branch/main/simple-jaeger.php"
|
PLUGIN_URL="https://git.nixc.us/colin/SimpleJaeger/raw/branch/main/simple-jaeger.php"
|
||||||
|
CONFIG_URL="https://git.nixc.us/colin/SimpleJaeger/raw/branch/main/simple-jaeger-config.php"
|
||||||
|
|
||||||
# Define the target directory
|
# Define the target directory
|
||||||
TARGET_DIR="wp-content/plugins/simple-jaeger"
|
TARGET_DIR="wp-content/plugins/simple-jaeger"
|
||||||
|
|
||||||
|
# Prompt user for Jaeger configuration
|
||||||
|
read -p "Enter Jaeger endpoint (default: http://localhost:14268/api/traces): " JAEGER_ENDPOINT
|
||||||
|
JAEGER_ENDPOINT=${JAEGER_ENDPOINT:-http://localhost:14268/api/traces}
|
||||||
|
|
||||||
|
read -p "Enter Jaeger service name (default: SimpleJaeger): " JAEGER_SERVICE_NAME
|
||||||
|
JAEGER_SERVICE_NAME=${JAEGER_SERVICE_NAME:-SimpleJaeger}
|
||||||
|
|
||||||
# Create the target directory if it doesn't exist
|
# Create the target directory if it doesn't exist
|
||||||
mkdir -p $TARGET_DIR
|
mkdir -p $TARGET_DIR
|
||||||
|
|
||||||
# Download the simple-jaeger.php file into the target directory
|
# Download the simple-jaeger.php file into the target directory
|
||||||
curl -o $TARGET_DIR/simple-jaeger.php $PLUGIN_URL
|
curl -o $TARGET_DIR/simple-jaeger.php $PLUGIN_URL
|
||||||
|
|
||||||
# Create a blank tracking-code.php file if it doesn't already exist
|
# Create the simple-jaeger-config.php file with the provided settings
|
||||||
touch $TARGET_DIR/tracking-code.php
|
cat <<EOL > $TARGET_DIR/simple-jaeger-config.php
|
||||||
|
<?php
|
||||||
|
return [
|
||||||
|
'JAEGER_ENDPOINT' => '$JAEGER_ENDPOINT',
|
||||||
|
'JAEGER_SERVICE_NAME' => '$JAEGER_SERVICE_NAME'
|
||||||
|
];
|
||||||
|
EOL
|
||||||
|
|
||||||
# Set the correct permissions for the files
|
# Set the correct permissions for the files
|
||||||
chmod 644 $TARGET_DIR/simple-jaeger.php
|
chmod 644 $TARGET_DIR/simple-jaeger.php
|
||||||
chmod 644 $TARGET_DIR/tracking-code.php
|
chmod 644 $TARGET_DIR/simple-jaeger-config.php
|
||||||
|
|
||||||
echo "SimpleJaeger plugin has been installed or updated successfully."
|
echo "SimpleJaeger plugin has been installed or updated successfully."
|
||||||
|
|
Loading…
Reference in New Issue