Skip to content

Commit

Permalink
Update provision script
Browse files Browse the repository at this point in the history
  • Loading branch information
dingo-d committed Dec 26, 2017
1 parent 1fac679 commit 6dc0a4d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
17 changes: 10 additions & 7 deletions browscap-full/provision.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/usr/bin/env bash

echo "Setting up Full Browsecap"

DIR=`dirname $0`

# Check PHP version
PHP_VER=`php -r \@phpinfo\(\)\; | grep 'PHP Version' -m 1 | grep -Po -m 1 '(\d+\.\d+)' | head -1`
MIN_REQ="5.3"

# Copy function
copy_browscap() {
# Remove any existing copies of the ini file and copy new one
rm "/etc/php/${PHP_VER}/mods-available/full_php_browscap.ini"
touch "/etc/php/${PHP_VER}/mods-available/full_php_browscap.ini"
cp "full_php_browscap.ini" "/etc/php/${PHP_VER}/mods-available/full_php_browscap.ini"
cp "${DIR}/full_php_browscap.ini" "/etc/php/${PHP_VER}/mods-available/full_php_browscap.ini"
echo "Full Browscap copied"
}

echo "Setting up Full Browsecap"

# Check PHP version
PHP_VER=`php -r \@phpinfo\(\)\; | grep 'PHP Version' -m 1 | grep -Po -m 1 '(\d+\.\d+)' | head -1`
MIN_REQ="5.3"

if (( $(echo "${PHP_VER} < ${MIN_REQ}" |bc -l) )); then
echo "The PHP version is lower than 5.3 so browscap won't work. Please upgrade your PHP version to higher than 5.3"
exit 0
Expand Down
17 changes: 10 additions & 7 deletions browscap-lite/provision.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/usr/bin/env bash

echo "Setting up Lite Browsecap"

DIR=`dirname $0`

# Check PHP version
PHP_VER=`php -r \@phpinfo\(\)\; | grep 'PHP Version' -m 1 | grep -Po -m 1 '(\d+\.\d+)' | head -1`
MIN_REQ="5.3"

# Copy function
copy_browscap() {
# Remove any existing copies of the ini file and copy new one
rm "/etc/php/${PHP_VER}/mods-available/lite_php_browscap.ini"
touch "/etc/php/${PHP_VER}/mods-available/lite_php_browscap.ini"
cp "lite_php_browscap.ini" "/etc/php/${PHP_VER}/mods-available/lite_php_browscap.ini"
cp "${DIR}/lite_php_browscap.ini" "/etc/php/${PHP_VER}/mods-available/lite_php_browscap.ini"
echo "Lite Browscap copied"
}

echo "Setting up Lite Browsecap"

# Check PHP version
PHP_VER=`php -r \@phpinfo\(\)\; | grep 'PHP Version' -m 1 | grep -Po -m 1 '(\d+\.\d+)' | head -1`
MIN_REQ="5.3"

if (( $(echo "${PHP_VER} < ${MIN_REQ}" |bc -l) )); then
echo "The PHP version is lower than 5.3 so browscap won't work. Please upgrade your PHP version to higher than 5.3"
exit 0
Expand Down
17 changes: 10 additions & 7 deletions browscap/provision.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/usr/bin/env bash

echo "Setting up Browsecap"

DIR=`dirname $0`

# Check PHP version
PHP_VER=`php -r \@phpinfo\(\)\; | grep 'PHP Version' -m 1 | grep -Po -m 1 '(\d+\.\d+)' | head -1`
MIN_REQ="5.3"

# Copy function
copy_browscap() {
# Remove any existing copies of the ini file and copy new one
rm "/etc/php/${PHP_VER}/mods-available/php_browscap.ini"
touch "/etc/php/${PHP_VER}/mods-available/php_browscap.ini"
cp "php_browscap.ini" "/etc/php/${PHP_VER}/mods-available/php_browscap.ini"
cp "${DIR}/php_browscap.ini" "/etc/php/${PHP_VER}/mods-available/php_browscap.ini"
echo "Browscap copied"
}

echo "Setting up Browsecap"

# Check PHP version
PHP_VER=`php -r \@phpinfo\(\)\; | grep 'PHP Version' -m 1 | grep -Po -m 1 '(\d+\.\d+)' | head -1`
MIN_REQ="5.3"

if (( $(echo "${PHP_VER} < ${MIN_REQ}" |bc -l) )); then
echo "The PHP version is lower than 5.3 so browscap won't work. Please upgrade your PHP version to higher than 5.3"
exit 0
Expand Down

0 comments on commit 6dc0a4d

Please sign in to comment.