| echo usage: $0 "[initdb | resetdb ]" |
| #Figure out if the script is running on Fedora 16 or 17 |
| if grep 16 /etc/fedora-release; then |
| sudo -u postgres initdb -D /var/lib/pgsql/data/ |
| sudo -u postgres pg_ctl -D /var/lib/pgsql/data -l logfile start |
| #Try normal Fedora 17 commands |
| echo "Trying Fedora 17 commands" > /dev/stdout |
| /sbin/service postgresql initdb |
| /sbin/service postgresql start |
| /sbin/chkconfig postgresql on |
| echo "Creating OpenCloud database..." |
| sudo -u postgres createdb planetstack |
| echo "Dropping OpenCloud database..." |
| sudo -u postgres dropdb planetstack |
| echo "Syncing OpenCloud services..." |
| python /opt/planetstack/manage.py syncdb --noinput |
| # python manage.py runserver 128.95.1.128:8000 |
| echo "Starting OpenCloud Service on $HOSTNAME:8000" |
| python manage.py runserver $HOSTNAME:8000& |
| if [ "$COMMAND" = "initdb" ]; then |
| if [ "$COMMAND" = "resetdb" ]; then |
| if [ "$COMMAND" = "syncdb" ]; then |
| if [ "$COMMAND" = "runserver" ]; then |