Skip to content

Commit

Permalink
chore: Update addons.rst with redis patch installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean28518 committed Aug 1, 2024
1 parent 747ac53 commit b6cb1a7
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions docs/modules/addons.rst
Original file line number Diff line number Diff line change
Expand Up @@ -227,34 +227,34 @@ Also it is highly recommended to keep your addon constistent over time, so it sh

Here you can see an example of a redis patch for nextloud:

```bash
#!/bin/bash
# IS THIS PATCH OLDER THAN 365 DAYS?
# Get the current file name
FILE_NAME=$(basename $0)
# Get the date of the filename which is like this: 2024-06-25
DATE=${FILE_NAME:0:10}
# Check if the file is older than 365 days
if [ $(( ($(date +%s) - $(date -d $DATE +%s)) / 86400 )) -gt 365 ]; then
echo "Patch is older than 365 days. Exiting patch."
exit 0
fi
# Check if we need to apply the patch
# Is redis installed?
if [ -x "$(command -v redis-server)" ]; then
echo "Redis is already installed. Exiting patch."
exit 0
fi
# BEGIN APPLYING PATCH
# Install redis and php packages
apt-get install redis php-redis php-apcu php-memcache pwgen -y
# ... do the rest
```
.. code-block:: bash
#!/bin/bash
# IS THIS PATCH OLDER THAN 365 DAYS?
# Get the current file name
FILE_NAME=$(basename $0)
# Get the date of the filename which is like this: 2024-06-25
DATE=${FILE_NAME:0:10}
# Check if the file is older than 365 days
if [ $(( ($(date +%s) - $(date -d $DATE +%s)) / 86400 )) -gt 365 ]; then
echo "Patch is older than 365 days. Exiting patch."
exit 0
fi
# Check if we need to apply the patch
# Is redis installed?
if [ -x "$(command -v redis-server)" ]; then
echo "Redis is already installed. Exiting patch."
exit 0
fi
# BEGIN APPLYING PATCH
# Install redis and php packages
apt-get install redis php-redis php-apcu php-memcache pwgen -y
# ... do the rest
General Tips
Expand Down

0 comments on commit b6cb1a7

Please sign in to comment.