Skip to content

Commit 3f28027

Browse files
committed
Merge branch 'python' of github.com:rtCamp/easyengine into python
2 parents 2ca2191 + a462bf8 commit 3f28027

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

install

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# to update current EasyEngine from 2.x to 3.x
66

77
old_ee_version="2.2.3"
8+
new_ee_version="3.0.1"
89
branch=$1
910

1011
# Define echo function
@@ -196,9 +197,27 @@ function update_to_ee3()
196197

197198
}
198199

200+
function update_to_ee_latest()
201+
{
202+
ee_lib_echo "Updating Nginx configuration"
203+
if [ -f /etc/nginx/ee-nginx.conf ]; then
204+
sed -i "s/X-Powered-By.*/X-Powered-By \"EasyEngine $new_ee_version\";/" /etc/nginx/nginx.conf &>> /dev/null
205+
elif [ -f /etc/nginx/nginx.conf ]; then
206+
sed -i "s/X-Powered-By.*/X-Powered-By \"EasyEngine $new_ee_version\";/" /etc/nginx/nginx.conf &>> /dev/null
207+
fi
208+
}
209+
199210
function git_init()
200211
{
201-
# Do git intialisation on EasyEngine configuration
212+
# Do git intialisation on EasyEngine adn Nginx configuration
213+
if [ -d /etc/nginx ];then
214+
cd /etc/nginx
215+
if [ ! -d /etc/nginx/.git ]; then
216+
git init > /dev/null
217+
fi
218+
git add .
219+
git commit -am "Updated Nginx" > /dev/null
220+
fi
202221
cd /etc/ee
203222
if [ ! -d /etc/ee/.git ]; then
204223
git init > /dev/null
@@ -282,6 +301,13 @@ elif [ ! -f /usr/local/bin/ee ]; then
282301
install_ee3 | tee -ai $EE_INSTALL_LOG
283302
git_init | tee -ai $EE_INSTALL_LOG
284303
else
285-
ee_lib_echo_fail "EasyEngine 3 allready installed on your system" | tee -ai $EE_INSTALL_LOG
304+
ee -v 2>&1 | grep $new_ee_version &>> /dev/null
305+
if [[ $? -ne 0 ]];then
306+
update_to_ee_latest | tee -ai $EE_INSTALL_LOG
307+
install_ee3 | tee -ai $EE_INSTALL_LOG
308+
git_init | tee -ai $EE_INSTALL_LOG
309+
service nginx reload &>> /dev/null
310+
fi
311+
ee_lib_echo_fail "You allready have EasyEngine $new_ee_version" | tee -ai $EE_INSTALL_LOG
286312
exit 1
287313
fi

0 commit comments

Comments
 (0)