0
1
Fork 0
hedera-web-mindshore/utils/update-browscap.sh

21 lines
563 B
Bash
Raw Permalink Normal View History

#!/bin/bash
phpCfgDir=/etc/php
browscapFile="$phpCfgDir/lite_php_browscap.ini"
versionFile="$phpCfgDir/browscap.version"
currentVersion=0
if [ -f "$versionFile" ]; then
currentVersion=$(cat "$phpCfgDir/browscap.version")
fi
2020-01-23 07:32:18 +00:00
lastVersion=$(curl -s http://browscap.org/version-number)
if [ "$lastVersion" -gt "$currentVersion" ] || [ ! -f "$browscapFile" ]; then
echo -n "$lastVersion" > "$versionFile"
2020-01-23 07:32:18 +00:00
curl -s -o "$browscapFile" https://browscap.org/stream?q=Lite_PHP_BrowsCapINI
echo "Browscap updated."
else
echo "Browscap up to date."
fi