mindoc/start.sh

31 lines
1016 B
Bash
Raw Normal View History

2021-06-29 14:24:52 +08:00
#!/bin/bash
2021-07-06 15:19:55 +08:00
set -eux
2022-07-25 11:56:55 +08:00
# 默认资源
if [ ! -d "/mindoc/conf" ]; then mkdir -p "/mindoc/conf" ; fi
if [[ -z "$(ls -A -- "/mindoc/conf")" ]] ; then cp -r "/mindoc/__default_assets__/conf" "/mindoc/" ; fi
if [ ! -d "/mindoc/static" ]; then mkdir -p "/mindoc/static" ; fi
if [[ -z "$(ls -A -- "/mindoc/static")" ]] ; then cp -r "/mindoc/__default_assets__/static" "/mindoc/" ; fi
if [ ! -d "/mindoc/views" ]; then mkdir -p "/mindoc/views" ; fi
if [[ -z "$(ls -A -- "/mindoc/views")" ]] ; then cp -r "/mindoc/__default_assets__/views" "/mindoc/" ; fi
if [ ! -d "/mindoc/uploads" ]; then mkdir -p "/mindoc/uploads" ; fi
if [[ -z "$(ls -A -- "/mindoc/uploads")" ]] ; then cp -r "/mindoc/__default_assets__/uploads" "/mindoc/" ; fi
# 如果配置文件不存在就复制
cp --no-clobber /mindoc/conf/app.conf.example /mindoc/conf/app.conf
2021-07-07 18:44:35 +08:00
# 数据库等初始化
2018-06-06 11:43:25 +08:00
/mindoc/mindoc_linux_amd64 install
2021-06-29 14:24:52 +08:00
2021-07-07 18:44:35 +08:00
# 运行
2022-07-25 11:56:55 +08:00
/mindoc/mindoc_linux_amd64
# # Debug Dockerfile
# while [ 1 ]
# do
# echo "log ..."
# sleep 5s
# done