# To allow outside connections to the database (If you don't need them, don't # use them--this is recommended to increase security), uncomment the next line: #NET='-o \"-i\"' # Start PostgreSQL: postgresql_start() { if [ -x /usr/local/pgsql/bin/pg_ctl ]; then su - postgres -c "/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data $NET -l /home/postgres/logfile start" fi /usr/local/OpenNMS/bin/opennms start /usr/local/tomcat/bin/startup.sh } # Stop PostgreSQL: postgresql_stop() { /usr/local/tomcat/bin/shutdown.sh /usr/local/OpenNMS/bin/opennms stop if [ -x /usr/local/pgsql/bin/pg_ctl ]; then su - postgres -c "/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data $NET -l /home/postgres/logfile -m fast stop" fi } # Restart PostgreSQL: postgresql_restart() { postgresql_stop postgresql_start } case "$1" in 'start') postgresql_start ;; 'stop') postgresql_stop ;; 'restart') postgresql_restart ;; *) echo "usage $0 start|stop|restart" esac