Skip to content

Instantly share code, notes, and snippets.

@xiujiao
Created March 18, 2015 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiujiao/755e5d56c2929ee27b05 to your computer and use it in GitHub Desktop.
Save xiujiao/755e5d56c2929ee27b05 to your computer and use it in GitHub Desktop.
#!/bin/bash
RUN_DIR=/var/vcap/sys/run/api_ui
LOG_DIR=/var/vcap/sys/log/api_ui
PIDFILE=${RUN_DIR}/pid
case $1 in
start)
mkdir -p $RUN_DIR $LOG_DIR
chown -R vcap:vcap $RUN_DIR $LOG_DIR
echo $$ >> $PIDFILE
cd /var/vcap/packages/api_ui
export PATH=/var/vcap/packages/go/bin:$PATH
exec ?? what we excute here?
stop)
kill -9 `cat $PIDFILE`
rm -f $PIDFILE
;;
*)
echo "Usage: ctl {start|stop}" ;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment