代码拉取完成,页面将自动刷新
#!/bin/sh
NAME=gogs
DESC=gogs
SCRIPT_DIR=$(cd $(dirname $0) && pwd)
source ./config
start_gogs() {
# Start the daemon/service
#
# Returns:
# 0 if gogs has been started
# 1 if gogs was already running
# 2 if gogs could not be started
docker run --restart always -d --name=gogs -v $GOGS_DATADIR:/data -p 8094:3000 -p 10022:22 -d gogs/gogs > /dev/null \
|| return 0
}
restart_gogs() {
docker restart gogs
}
stop_gogs() {
# Stops the daemon/service
#
# Return
# 0 if gogs has been stopped
# 1 if gogs was already stopped
# 2 if gogs could not be stopped
# other if a failure occurred
docker stop gogs
sleep 1
return 0
}
clean_gogs() {
docker rm -f gogs
}
logs_gogs() {
docker logs gogs
return 0
}
case "$1" in
start)
echo "Starting $DESC" "$NAME"
start_gogs
case "$?" in
esac
;;
stop)
echo "Stopping $DESC" "$NAME"
stop_gogs
case "$?" in
esac
;;
restart)
echo "Restarting $DESC" "$NAME"
restart_gogs
;;
logs)
logs_gogs
;;
clean)
clean_gogs
;;
*)
echo "Usage: $NAME {start|stop|restart|logs|clean}" >&2
exit 3
;;
esac
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。