Skip to content

Instantly share code, notes, and snippets.

@posulliv
Created May 21, 2009 19:10
Show Gist options
  • Save posulliv/115654 to your computer and use it in GitHub Desktop.
Save posulliv/115654 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -ne 1 ]
then
echo "incorrect number of arguments"
echo "Usage"
echo "./script DRIZZLE_BUILD_ROOT_DIR"
exit 1
fi
bin_dir=$1
if [ ! -d ${bin_dir} ]
then
echo "Specified Drizzle build directory does not exist!"
exit 1
fi
proc=`ps -ef | \
grep drizzle | \
grep -v -e 'grep drizzle' \
-e 'bash' | \
tee /dev/tty | \
awk '{print $2}'`
if [ `echo "$proc" | wc -w` -ne 0 ]
then
echo "Drizzle is already running..."
exec gdb ${bin_dir}/drizzled/drizzled -silent "$proc"
else
echo "Drizzle is not already running..."
exec gdb ${bin_dir}/drizzled/drizzled
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment