diff --git a/debian/noosfero.postinst b/debian/noosfero.postinst index 21c6dad..3dfe077 100644 --- a/debian/noosfero.postinst +++ b/debian/noosfero.postinst @@ -9,6 +9,26 @@ makedir() { chown noosfero:noosfero $1 } + +# migrate mongrel configuration to thin +mongrel_config=/etc/noosfero/mongrel_cluster.yml +thin_config=/etc/noosfero/thin.yml +mongrel_orig_sha1=602c642c03f79349969c08330112a6f29d4c32aa +if [ -r $mongrel_config ]; then + mongrel_sha1=$(sha1sum $mongrel_config | awk '{print $1}') + if [ "$mongrel_sha1" != "$mongrel_orig_sha1" ]; then + port=$(awk '{ if ($1 == "port:") { print($2) } }' $mongrel_config) + servers=$(awk '{ if ($1 == "servers:") { print($2) } }' $mongrel_config) + if test -n "$port" && test "$port" -ne 50000 || test -n "$servers" && test "$servers" -ne 1 ; then + # mongrel configuration was changed; update thin configuration + # accordingly + sed -i -e "s/port: .*/port: $port/" $thin_config + sed -i -e "s/servers: .*/servers: $servers/" $thin_config + fi + fi + mv $mongrel_config $mongrel_config.bak +fi + # create user noosfero in a portable way, while creating the log directory. # (idea taken from the postfix package) ############################################################################## -- libgit2 0.21.2