Skip to content

Commit

Permalink
Overwrite if server block exists
Browse files Browse the repository at this point in the history
This is to prevent duplicate server blocks in a single file which gives errors when trying to restart nginx.
  • Loading branch information
driesvints committed May 22, 2014
1 parent 4b0a734 commit c39c307
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ block="server {
}
"

echo "$block" >> "/etc/nginx/sites-available/$1"
echo "$block" > "/etc/nginx/sites-available/$1"
ln -s "/etc/nginx/sites-available/$1" "/etc/nginx/sites-enabled/$1"
service nginx restart
service php5-fpm restart

0 comments on commit c39c307

Please sign in to comment.