mirror of
https://github.com/ledccn/IYUUPlus.git
synced 2024-09-20 15:15:29 +00:00
32 lines
726 B
Bash
Executable File
32 lines
726 B
Bash
Executable File
#!/bin/sh
|
||
|
||
cd /IYUU
|
||
|
||
if [[ ! -d /IYUU/.git || ! -f /IYUU/.env ]]; then
|
||
#git clone https://github.com/ledccn/IYUUPlus.git /tmp/IYUU
|
||
git clone https://gitee.com/ledc/iyuuplus.git /tmp/IYUU
|
||
find /tmp/IYUU -mindepth 1 -maxdepth 1 | xargs -I {} cp -r {} /IYUU
|
||
rm -rf /tmp/IYUU
|
||
else
|
||
git fetch --all
|
||
git reset --hard origin/master
|
||
git pull
|
||
fi
|
||
|
||
if [ ! -s .env ]; then
|
||
cp .env.example .env
|
||
fi
|
||
|
||
if [[ -z ${CRON_UPDATE} ]]; then
|
||
CRON_UPDATE="23 3-23/6 * * *"
|
||
fi
|
||
|
||
echo "设置cron..."
|
||
echo "${CRON_UPDATE} cd /IYUU && git fetch --all && git reset --hard origin/master && git pull && php start.php restart -d" | crontab -
|
||
|
||
echo "当前crontab如下:"
|
||
crontab -l
|
||
|
||
php /IYUU/start.php start -d
|
||
crond -f
|