Files
ulthon_admin/docker/run.sh
2024-04-19 23:32:45 +08:00

29 lines
966 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 将代码中的nginx复制到nginx配置文件中
cp /var/www/html/docker/nginx.conf /etc/nginx/sites-available/default
ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
# 将代码中的php配置文件复制到php配置文件中
cp /var/www/html/docker/zz-phprun.ini /usr/local/etc/php/conf.d
cp /var/www/html/docker/zz-phpfpm.conf /usr/local/etc/php-fpm.d
# 运行redis
nohup redis-server --requirepass "" &
# 运行定时任务
nohup php /var/www/html/think timer --local --quit &
# 输出参数
echo "参数为:$@"
# TODO增加自动批量运行并阻塞的脚本比如group default 会调用auto.sh的default的部分最终阻塞auth.sh的default部分可能会运行一系列的命令比如清空缓存踢人下线重置密码
if [ "$1" = "server" ] || [ "$1" = "" ]; then
# 运行nginx
service nginx start
# 运行php-fpm
php-fpm
else
php "/var/www/html/""$@"
fi