File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -107,10 +107,15 @@ cd "$WORKDIR"
107107git clone https://github.com/TIOJ-INFOR-Online-Judge/tioj.git
108108git clone https://github.com/TIOJ-INFOR-Online-Judge/tioj-judge.git
109109
110+ function Cleanup {
111+ sudo rm -rf $PASSENGER_LOG
112+ }
113+
110114# Install gems
111115cd " $WORKDIR /tioj"
112116gem install passenger:' ~> 6' -N
113117PASSENGER_LOG=$( sudo mktemp -d)
118+ trap Cleanup EXIT
114119sudo chmod 755 $PASSENGER_LOG
115120export rvmsudo_secure_path=1
116121rvmsudo -b bash -c " passenger-install-nginx-module --force-colors --auto --auto-download --languages ruby > $PASSENGER_LOG /log 2>&1; touch $PASSENGER_LOG /finished"
@@ -182,7 +187,6 @@ until stat $PASSENGER_LOG/finished > /dev/null 2>&1; do
182187 sleep 1
183188done
184189kill $TAIL_PID
185- sudo rm -rf $PASSENGER_LOG
186190sudo sed -i " s/^.*nobody.*$/user $USER ;/" /opt/nginx/conf/nginx.conf
187191sudo sed -i ' s/http {/\0\n passenger_app_env production;/' /opt/nginx/conf/nginx.conf
188192sudo sed -i " s|^[^#]*server_name.*localhost.*$|\0\n passenger_enabled on;\n root $( pwd) /public;|" /opt/nginx/conf/nginx.conf
You can’t perform that action at this time.
0 commit comments