Skip to content

Instantly share code, notes, and snippets.

@csinchok
Created October 17, 2014 18:37
Show Gist options
  • Select an option

  • Save csinchok/4ecbd36d62e4dfaacc84 to your computer and use it in GitHub Desktop.

Select an option

Save csinchok/4ecbd36d62e4dfaacc84 to your computer and use it in GitHub Desktop.
#!/bin/sh
wget -O /tmp/onion-devel.sql.bz2 http://192.168.1.26/onion/onion.sql.bz2
export PGPASSWORD=testonion
psql -d postgres -h 127.0.0.1 -U onion -c "DROP DATABASE onion"
psql -d postgres -h 127.0.0.1 -U onion -c "CREATE DATABASE onion"
bunzip2 /tmp/onion-devel.sql.bz2
sed -i '/character varying(255)/character varying(510)/g' /tmp/onion-devel.sql
psql -d onion -U onion -h localhost < /tmp/onion-devel.sql
rm /tmp/onion-devel.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment