resolved ordering error in subst for nginx phphander

updating .insert first then copying to nginx.conf
This commit is contained in:
Asif Bacchus 2019-01-06 02:33:00 -07:00
parent 45379c4908
commit db8662c7fc
2 changed files with 8 additions and 8 deletions

View File

@ -6,13 +6,13 @@
-1,
30,
43,
668,
-1,
-1,
-1,
607,
-1,
630
-1,
-1,
-1
]
}
]

View File

@ -644,20 +644,20 @@ fi
## if using PHP-TCP: add upstream handler in nginx.conf
if [ "${phpType}" = "tcp" ]; then
echo -e "updating ${warn}${configPath}/${file_phphandler}${norm}"
# copy .insert file into nginx.conf
sed -i -e "/${tag_phphandler}/{r ${configPath}/${file_phpTCP}" -e 'd}' "${configPath}/${file_phphandler}"
# update tags with address and port information
# update .insert tags with address and port information
sed -i "s/${tag_phpAddr}/${phpAddr}/" "${configPath}/${file_phpTCP}"
sed -i "s/${tag_phpPort}/${phpPort}/" "${configPath}/${file_phpTCP}"
# copy .insert file into nginx.conf
sed -i -e "/${tag_phphandler}/{r ${configPath}/${file_phpTCP}" -e 'd}' "${configPath}/${file_phphandler}"
fi
# if using PHP-SOCK: add upstream handler in nginx.conf
if [ "${phpType}" = "sockets" ]; then
echo -e "updating ${warn}${configPath}/${file_phphandler}${norm}"
# update .insert tag with version number
sed -i "s/${tag_phpVersion}/${phpVersion}/" "${configPath}/${file_phpSOCK}"
# copy .insert file into nginx.conf
sed -i -e "/${tag_phphandler}/{r ${configPath}/${file_phpSOCK}" -e 'd}' "${configPath}/${file_phphandler}"
# update tag with version number
sed -i "s/${tag_phpVersion}/${phpVersion}/" "${configPath}/${file_phpSOCK}"
fi
# notify user file updates are completed