mirror of https://github.com/MISP/misp-packer
comment non-standard bash script
parent
59d8b5e9bd
commit
90c12fd404
|
@ -1,36 +1,36 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
## Source of the vercomp function: https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash
|
## Source of the vercomp function: https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash
|
||||||
vercomp () {
|
# vercomp () {
|
||||||
if [[ $1 == $2 ]]
|
# if [[ $1 == $2 ]]
|
||||||
then
|
# then
|
||||||
return 0
|
# return 0
|
||||||
fi
|
# fi
|
||||||
local IFS=.
|
# local IFS=.
|
||||||
local i ver1=($1) ver2=($2)
|
# local i ver1=($1) ver2=($2)
|
||||||
# fill empty fields in ver1 with zeros
|
# # fill empty fields in ver1 with zeros
|
||||||
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++))
|
# for ((i=${#ver1[@]}; i<${#ver2[@]}; i++))
|
||||||
do
|
# do
|
||||||
ver1[i]=0
|
# ver1[i]=0
|
||||||
done
|
# done
|
||||||
for ((i=0; i<${#ver1[@]}; i++))
|
# for ((i=0; i<${#ver1[@]}; i++))
|
||||||
do
|
# do
|
||||||
if [[ -z ${ver2[i]} ]]
|
# if [[ -z ${ver2[i]} ]]
|
||||||
then
|
# then
|
||||||
# fill empty fields in ver2 with zeros
|
# # fill empty fields in ver2 with zeros
|
||||||
ver2[i]=0
|
# ver2[i]=0
|
||||||
fi
|
# fi
|
||||||
if ((10#${ver1[i]} > 10#${ver2[i]}))
|
# if ((10#${ver1[i]} > 10#${ver2[i]}))
|
||||||
then
|
# then
|
||||||
return 1
|
# return 1
|
||||||
fi
|
# fi
|
||||||
if ((10#${ver1[i]} < 10#${ver2[i]}))
|
# if ((10#${ver1[i]} < 10#${ver2[i]}))
|
||||||
then
|
# then
|
||||||
return 2
|
# return 2
|
||||||
fi
|
# fi
|
||||||
done
|
# done
|
||||||
return 0
|
# return 0
|
||||||
}
|
# }
|
||||||
|
|
||||||
MISP_BRANCH='2.4'
|
MISP_BRANCH='2.4'
|
||||||
|
|
||||||
|
@ -75,13 +75,14 @@ upload_max_filesize=50M
|
||||||
post_max_size=50M
|
post_max_size=50M
|
||||||
max_execution_time=300
|
max_execution_time=300
|
||||||
memory_limit=512M
|
memory_limit=512M
|
||||||
|
PHP_INI=/etc/php/7.0/apache2/php.ini
|
||||||
## Starting Ubuntu 18.04 php71 is default
|
## Starting Ubuntu 18.04 php71 is default
|
||||||
vercomp 18.04 ${UBUNTU_VERSION}
|
# vercomp 18.04 ${UBUNTU_VERSION}
|
||||||
case $? in
|
# case $? in
|
||||||
0) op='=';PHP_INI=/etc/php/7.1/apache2/php.ini;;
|
# 0) op='=';PHP_INI=/etc/php/7.1/apache2/php.ini;;
|
||||||
1) op='>';PHP_INI=/etc/php/7.1/apache2/php.ini;;
|
# 1) op='>';PHP_INI=/etc/php/7.1/apache2/php.ini;;
|
||||||
2) op='<';PHP_INI=/etc/php/7.0/apache2/php.ini;;
|
# 2) op='<';PHP_INI=/etc/php/7.0/apache2/php.ini;;
|
||||||
esac
|
# esac
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue