Skip to content

Commit 9392655

Browse files
committed
enable symlink protection only if nginx is higher than 1.0
1 parent efcbd1a commit 9392655

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

upd/convert-templates.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ sed -i '/Symlinks protection/d' /etc/nginx/nginx.conf
117117
sed -i '/disable_symlinks.*/d' /etc/nginx/nginx.conf
118118

119119
# Add improved symlink protection
120-
if [ -e "$TPL/nginx" ]; then
120+
nginx_version=$(rpm -q nginx| grep nginx-1| cut -f 2 -d .)
121+
if [ -e "/tmp/nginx" ] && [[ "$nginx_version" -gt '0' ]]; then
121122
for tpl in $(ls $TPL/nginx |grep -v proxy_ip.tpl); do
122123
check_symlink=$(grep disable_symlinks $TPL/nginx/$tpl)
123124
if [ -z "$check_symlink" ]; then

0 commit comments

Comments
 (0)