Update install.sh
This commit is contained in:
parent
de5b12f1cf
commit
170a255d2c
22
install.sh
22
install.sh
|
@ -1,26 +1,22 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Define plugin details
|
# Define plugin details
|
||||||
PLUGIN_URL="https://git.nixc.us/colin/SimpleTracking/raw/branch/main/simple-tracking.php"
|
PLUGIN_URL="https://git.nixc.us/colin/simple-glitchtip/raw/branch/main/simple-glitchtip.php"
|
||||||
PLUGIN_DIR="./wp-content/plugins/simple-tracking"
|
RAVEN_CLIENT_URL="https://github.com/getsentry/sentry-php/releases/download/3.5.1/sentry-php.phar"
|
||||||
|
PLUGIN_DIR="./wp-content/plugins/simple-glitchtip"
|
||||||
|
|
||||||
# Create plugin directory if it doesn't exist
|
# Create plugin directory if it doesn't exist
|
||||||
mkdir -p "$PLUGIN_DIR"
|
mkdir -p "$PLUGIN_DIR"
|
||||||
|
|
||||||
# Download the plugin file
|
# Download the plugin file
|
||||||
curl -o "$PLUGIN_DIR/simple-tracking.php" "$PLUGIN_URL"
|
curl -o "$PLUGIN_DIR/simple-glitchtip.php" "$PLUGIN_URL"
|
||||||
|
|
||||||
# Create a blank tracking-code.php file if it doesn't exist
|
# Download the Raven client (Sentry/Glitchtip SDK)
|
||||||
if [ ! -f "$PLUGIN_DIR/tracking-code.php" ]; then
|
curl -o "$PLUGIN_DIR/raven-client.phar" -L "$RAVEN_CLIENT_URL"
|
||||||
touch "$PLUGIN_DIR/tracking-code.php"
|
|
||||||
echo "Please add your tracking code to wp-content/plugins/simple-tracking/tracking-code.php."
|
|
||||||
else
|
|
||||||
echo "tracking-code.php already exists."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set correct permissions
|
# Set correct permissions
|
||||||
chmod 644 "$PLUGIN_DIR/simple-tracking.php"
|
chmod 644 "$PLUGIN_DIR/simple-glitchtip.php"
|
||||||
chmod 644 "$PLUGIN_DIR/tracking-code.php"
|
chmod 644 "$PLUGIN_DIR/raven-client.phar"
|
||||||
|
|
||||||
# Inform user
|
# Inform user
|
||||||
echo "Simple Tracking plugin installed/updated successfully."
|
echo "Simple Glitchtip plugin installed/updated successfully."
|
||||||
|
|
Loading…
Reference in New Issue