make news more compatible with other distros.

This commit is contained in:
Storm Dragon 2021-07-01 02:09:12 -04:00
parent 1ba82cb96e
commit 5352a68178

View File

@ -49,10 +49,11 @@ export DIALOGOPTS='--no-lines --visit-items'
# Check for latest news # Check for latest news
check_news() { check_news() {
trap return INT
# url for news file # url for news file
local newsFile="https://stormgames.wolfe.casa/media/agm.ogg" local newsFile="https://stormgames.wolfe.casa/media/agm.ogg"
local newsPath="${configFile%/*.conf}/.news" local newsPath="${configFile%/*.conf}/.news"
local newsTag="$(curl --connect-timeout 15 -sI "$newsFile" | grep 'etag: "' | cut -d '"' -f2)" local newsTag="$(curl --connect-timeout 5 -sI "$newsFile" | grep -i '^etag: "' | cut -d '"' -f2)"
local newsOldTag="$(cat "$newsPath" 2> /dev/null)" local newsOldTag="$(cat "$newsPath" 2> /dev/null)"
if [[ "$newsTag" != "$newsOldTag" ]]; then if [[ "$newsTag" != "$newsOldTag" ]]; then
dialog --yes-label 'Play' \ dialog --yes-label 'Play' \