2
0
Fork 0
SimpleOtel-c5/install.sh

30 lines
946 B
Bash

#!/bin/bash
# Define plugin details
PLUGIN_URL="https://git.nixc.us/colin/SimpleOtel/raw/branch/main/simple-otel.php"
PLUGIN_DIR="./wp-content/plugins/simple-otel"
# Create plugin directory if it doesn't exist
mkdir -p "$PLUGIN_DIR"
# Download the plugin file
curl -o "$PLUGIN_DIR/simple-otel.php" "$PLUGIN_URL"
# Create a blank config.php file if it doesn't exist
if [ ! -f "$PLUGIN_DIR/config.php" ]; then
touch "$PLUGIN_DIR/config.php"
echo "<?php" > "$PLUGIN_DIR/config.php"
echo "// Configuration for Simple Otel plugin" >> "$PLUGIN_DIR/config.php"
echo "// Add your configurations here" >> "$PLUGIN_DIR/config.php"
echo "Configuration file created at wp-content/plugins/simple-otel/config.php."
else
echo "config.php already exists."
fi
# Set correct permissions
chmod 644 "$PLUGIN_DIR/simple-otel.php"
chmod 644 "$PLUGIN_DIR/config.php"
# Inform user
echo "Simple Otel plugin installed/updated successfully."