1. restart.sh

#!/bin/bash
echo "go build"
# git pull 
go mod tidy
go build -o go-admin main.go
echo "kill go-admin service"
killall go-admin # kill go-admin service
nohup ./go-admin server -c=config/settings.dev.yml >> access.log 2>&1 & #后台启动服务将日志写入access.log文件
echo "run go-admin success"
ps -aux | grep go-admin

2. stop.sh

#!/bin/bash
#!/bin/bash   grep -v 排除不包含
ps -ef |grep "puma 3.12.0"| grep -v "grep --color" | awk '{print $2}' |xargs kill -9
#killall go-admin # kill go-admin service
echo "stop go-admin success"
ps -aux | grep go-admin
作者:海马  创建时间:2023-05-07 07:52
最后编辑:海马  更新时间:2024-12-22 19:32