Created
September 14, 2012 21:13
-
-
Save terrycojones/3724876 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
file=/etc/postgresql/9.1/main/postgresql.conf | |
current=`egrep "^[ ]*bytea_output[ ]*=" $file | tr -d "' " | cut -f1 -d\# | tr = ' ' | cut -f2 -d' '` | |
case "$current" in | |
'' ) echo "bytea_output = 'escape'" >> $file ;; | |
escape) ;; # Do nothing, the existing value is correct. | |
hex) echo "Incompatible setting: $current"; exit 1;; | |
*) echo "wtf.... unknown value $current"; exit 2;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment