Update Check Shell Script for Shopware
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Description | |
# This script will send an email when new updates for your Shopware installation are available. | |
# A Bash-script runed by an cronjob checks via console command for new updates and send you a mail. | |
# Usage | |
# Set SHOPWARE_PATH to your shopware docroot path. Change MAILTO to your email address. | |
# Try it and finally add a new cronjob to run once every night. | |
SHOPWARE_PATH="/var/www/vhosts/shopware/docroot" | |
MAILTO="root" | |
SUBJECT="Shopware Update!" | |
MAIL=$(which mail) | |
PHPCLI=$(which php) | |
TMPFLE=$(tempfile) | |
$PHPCLI $SHOPWARE_PATH/bin/console sw:store:list:updates --no-ansi > $TMPFLE | |
if [[ $(wc -l $TMPFLE | cut -d" " -f1) > 3 ]]; then | |
MAILRC=/dev/null $MAIL -n -s "$SUBJECT" $MAILTO < $TMPFLE | |
fi | |
rm $TMPFLE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment