- PHP 7.4 support - Improved Webp images support with Cloudflare (Issue [#95](https://github.com/WordOps/WordOps/issues/95)). Nginx will not serve webp images alternative with Cloudflare IP ranges. - Stack upgrade for adminer - Check acme.sh installation and setup acme.sh if needed before issuing certificate - Add `--ufw` to `wo stack status` - Add Nginx directive `gzip_static on;` to serve precompressed assets with Cache-Enabler or WP-Rocket. (Issue [#207](https://github.com/WordOps/WordOps/issues/207)) - Previous `--php73` & `--php73=off` flags are replaced by `--php72`, `--php73`, `--php74` to switch site's php version - phpMyAdmin updated to v4.9.2 - Adminer updated to v4.7.5 - Replace dot and dashes by underscores in database names (Issue [#206](https://github.com/WordOps/WordOps/issues/206)) - Increased database name length to 32 characters from domain name + 8 random characters - typo error in motd-news script (Issue [#204](https://github.com/WordOps/WordOps/issues/204)) - Install Nginx before ngxblocker - WordOps install/update script text color - Issue with MySQL stack on Raspbian 9/10 - Typo error (PR [#205](https://github.com/WordOps/WordOps/pull/205)) - php version in `wo debug` (PR [#209](https://github.com/WordOps/WordOps/pull/209)) - SSL certificates expiration display with shared wildcard certificates
42 lines
1.4 KiB
Plaintext
42 lines
1.4 KiB
Plaintext
#!/bin/sh
|
|
# script to update motd when a new WordOps release is available on Debian/Ubuntu
|
|
# the script is added in /etc/update-motd.d
|
|
|
|
safe_print() {
|
|
cat "$1" | head -n 10 | tr -d '\000-\011\013\014\016-\037' | cut -c -80
|
|
}
|
|
|
|
# Ensure sane defaults
|
|
[ -n "$URL" ] || URL="https://api.github.com/repos/WordOps/WordOps/releases/latest"
|
|
[ -n "$WAIT" ] || WAIT=5
|
|
[ -n "$CACHE" ] || CACHE="/var/cache/motd-wo"
|
|
|
|
# Generate our temp files, clean up when done
|
|
NEWS=$(mktemp) || exit 1
|
|
ERR=$(mktemp) || exit 1
|
|
CLOUD=$(mktemp) || exit 1
|
|
trap "rm -f $NEWS $ERR $CLOUD" HUP INT QUIT ILL TRAP BUS TERM
|
|
|
|
if [ -n "$(command -v curl)" ]; then
|
|
LATEST_RELEASE=$(curl -m 5 --retry 3 -sL "$URL" | jq -r '.tag_name' 2>&1)
|
|
fi
|
|
if [ -n "$(command -v wo)" ]; then
|
|
CURRENT_RELEASE=$(wo -v 2>&1 | grep v | awk -F " " '{print $2}')
|
|
fi
|
|
if [ -n "$CURRENT_RELEASE" ] && [ -n "$LATEST_RELEASE" ]; then
|
|
if [ "$CURRENT_RELEASE" != "$LATEST_RELEASE" ]; then
|
|
# display message with motd-news on Ubuntu
|
|
echo '*** A new WordOps release is available ***' >"$NEWS" 2>"$ERR"
|
|
|
|
echo
|
|
# At most, 10 lines of text, remove control characters, print at most 80 characters per line
|
|
safe_print "$NEWS"
|
|
# Try to update the cache
|
|
safe_print "$NEWS" 2>/dev/null >$CACHE || true
|
|
else
|
|
# clean news
|
|
echo '' >"$NEWS" 2>"$ERR"
|
|
safe_print "$NEWS" 2>/dev/null >$CACHE || true
|
|
fi
|
|
fi
|