2014-01-21 02:08:08 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-11-19 17:29:46 +00:00
|
|
|
# Generate from database (exported XML from the website) the part of nginx
|
|
|
|
# configuration file authenticating teams
|
|
|
|
|
2014-11-21 14:55:38 +00:00
|
|
|
cd $(dirname "$0")
|
|
|
|
|
|
|
|
curl http://localhost/$(grep prefix_admin onyx/config/root.xml | sed -E 's@.*<var.*>(.*)</var>.*@\1@')/teams/export 2> /dev/null | grep "<name id" | sed -E 's@^.*id="([0-9]+)".*>(.*)<.*$@ if ($ssl_client_s_dn ~ "/C=FR/ST=France/O=Epita/OU=SRS/CN=\2/") { set $team \1; }@'
|