2019-05-09 10:02:23 +00:00
|
|
|
#!/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)
|
2019-05-09 10:02:23 +00:00
|
|
|
|
|
|
|
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
|
2019-05-09 10:02:23 +00:00
|
|
|
echo "Browscap updated."
|
|
|
|
else
|
|
|
|
echo "Browscap up to date."
|
|
|
|
fi
|