#!/bin/csh -f # mongodb # ------------------------------------------------------------------------------ # Shell script to launch and manage MongoDB server. # ------------------------------------------------------------------------------ # Usage: See Usage section below or run with -h or --help option to see usage. # Assumptions: # Effects: # - Performs operations on the MongoDB server. # Notes: # Implementation Notes: # Portability Issues: # Revision History: # $Log$ # ------------------------------------------------------------------------------ if ("$1" == "-h" || "$1" == "--help") then echo "Usage:" echo " $0:t Start MongoDB client" echo " $0:t start Start MongoDB server" echo " $0:t web Show MongoDB Web client" echo " $0:t db_name Start MongoDB client opening specified DB" exit 1 endif set rc = 0 if ($#argv == 0) then mongo set rc = $status else if ($#argv == 1) then if ("$1" == "start") then mongod -f /etc/mongodb.conf set rc = $status else if ("$1" == "web") then open http://localhost:28017 set rc = $status else mongo $1:q endif else mongo $*:q endif exit $rc