From e04cfec056f53b619c6d6654a51c8eb2e2f46fa7 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Sun, 23 Jun 2013 13:47:19 -0700 Subject: [PATCH] Adding postgres apt script. --- config/nginx.newsblur.conf | 10 +-- config/postgres_apt.sh | 136 +++++++++++++++++++++++++++++++++++++ fabfile.py | 9 +-- 3 files changed, 146 insertions(+), 9 deletions(-) create mode 100755 config/postgres_apt.sh diff --git a/config/nginx.newsblur.conf b/config/nginx.newsblur.conf index b4ab30ca9..022f2de68 100644 --- a/config/nginx.newsblur.conf +++ b/config/nginx.newsblur.conf @@ -91,11 +91,11 @@ server { } location /munin/ { - # alias /var/cache/munin/www/; - fastcgi_split_path_info ^(/munin)(.*); - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_pass unix:/var/run/munin/fcgi-html.sock; - include fastcgi_params; + alias /var/cache/munin/www/; + # fastcgi_split_path_info ^(/munin)(.*); + # fastcgi_param PATH_INFO $fastcgi_path_info; + # fastcgi_pass unix:/var/run/munin/fcgi-html.sock; + # include fastcgi_params; } location ^~ /cgi-bin/munin-cgi-graph/ { diff --git a/config/postgres_apt.sh b/config/postgres_apt.sh new file mode 100755 index 000000000..c69103bb3 --- /dev/null +++ b/config/postgres_apt.sh @@ -0,0 +1,136 @@ +#!/bin/sh + +# script to add apt.postgresql.org to sources.list + +# from command like +CODENAME="$1" +# lsb_release is the best interface, but not always available +if [ -z "$CODENAME" ]; then + CODENAME=$(lsb_release -cs 2>/dev/null) +fi +# parse os-release (unreliable, does not work on Ubuntu) +if [ -z "$CODENAME" -a -f /etc/os-release ]; then + . /etc/os-release + # Debian: VERSION="7.0 (wheezy)" + # Ubuntu: VERSION="13.04, Raring Ringtail" + CODENAME=$(echo $VERSION | sed -ne 's/.*(\(.*\)).*/\1/') +fi +# guess from sources.list +if [ -z "$CODENAME" ]; then + CODENAME=$(grep '^deb ' /etc/apt/sources.list | head -n1 | awk '{ print $3 }') +fi +# complain if no result yet +if [ -z "$CODENAME" ]; then + cat < /etc/apt/sources.list.d/pgdg.list <