Skip to content

Instantly share code, notes, and snippets.

@osmanmakal
Last active March 16, 2023 13:23
Show Gist options
  • Select an option

  • Save osmanmakal/5c6961619d519a179aebbdc1ea04571b to your computer and use it in GitHub Desktop.

Select an option

Save osmanmakal/5c6961619d519a179aebbdc1ea04571b to your computer and use it in GitHub Desktop.
bee go supervisor script
#!/bin/bash
################## Supervisor ##################
# [program:repo]
# command=bash -c /go/src/repo/start.sh
# directory=/root
# autostart=true
# autorestart=true
# stderr_logfile=/var/log/repo-err.log
# stdout_logfile=/var/log/repo-out.log
# environment=GOPATH="/go"
################## Supervisor ##################
repo="repo"
unbuffer killall -9 bee > /dev/null
unbuffer killall -9 $repo > /dev/null
GOPATH="/go"
if [ -z $GOPATH ];then
echo "GOPATH not set!"
exit 1
fi
if [ -f $GOPATH/bin/bee ];then
go get -u github.com/astaxie/beego
go get -u github.com/beego/bee
go get -u github.com/tools/godep
fi
source /root/.profile
cd $GOPATH/src/$repo
$GOPATH/bin/godep get
$GOPATH/bin/bee run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment