21 lines
578 B
Bash
21 lines
578 B
Bash
|
#!/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
|
||
|
|
||
|
lastVersion=$(wget --quiet -O - http://browscap.org/version-number)
|
||
|
|
||
|
if [ "$lastVersion" -gt "$currentVersion" ] || [ ! -f "$browscapFile" ]; then
|
||
|
echo -n "$lastVersion" > "$versionFile"
|
||
|
wget --quiet -O "$browscapFile" https://browscap.org/stream?q=Lite_PHP_BrowsCapINI
|
||
|
echo "Browscap updated."
|
||
|
else
|
||
|
echo "Browscap up to date."
|
||
|
fi
|