更新run_daemon

This commit is contained in:
gfdgd_xi 2023-05-02 13:12:47 +08:00
parent 4937e60333
commit 06c763d862
1 changed files with 49 additions and 1 deletions

View File

@ -1,4 +1,30 @@
#/bin/bash
# 狗头
echo '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
echo '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`***,@@@@@@@@'
echo '@@@@^*****,\@@@@@@@@@@@@@@@@@@@@`*.....*\@@@@@@'
echo '@@@@*.......**\@[`***......*****.....*..*\@@@@@'
echo '@@@@^*..............................***...@@@@@'
echo '@@@@@*...............................**..*\@@@@'
echo '@@@@@^*..*............................*..*=@@@@'
echo '@@@@@^**................................**=@@@@'
echo '@@@@@/*..................................*=@@@@'
echo '@@@@@*..... ..... ............*@@@@'
echo '@@@@`*. .]]]]` ... ]/[[[O/O]`........*,@@@'
echo '@@@@*.=` =O.,OO......=` .OOOOOO^........*@@@'
echo '@@@^*.\ =OOOOO^.....=` .OOOOOO^........*=@@'
echo '@@@^*..,\].=OO/.........,[\]]O/[` ......*=@@'
echo '@@@@*...................... .*@@@'
echo '@@@@`. ......,]]...... .,@@@'
echo '@@@@@*. OOOOOOO^ .*@@@@'
echo '@@@@@\*. \OOOO` .*/@@@@'
echo '@@@@@@\*. =. / .*/@@@@@'
echo '@@@@@@@@`*. ,\OOOOOOO]]OO` .*,@@@@@@@'
echo '@@@@@@@@@@`*. . .*,@@@@@@@@@'
echo '@@@@@@@@@@@@\**.. ......... ..**/@@@@@@@@@@@'
echo '@@@@@@@@@@@@@@@@]`***......***,]@@@@@@@@@@@@@@@'
echo '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
# 使 UEngine 能在 Wayland 下运行
export XDG_SESSION_TYPE=x11
export QT_QPA_PLATFORM=xcb
@ -14,9 +40,31 @@ unset WAYLAND_DISPLAYCOPY
XDG_CURRENT_DESKTOP="Deepin"
export LD_LIBRARY_PATH=/usr/share/uengine/lib64/
# 判断 UEngine 是否被正确安装
which uengine
if [[ $? != 0 ]]; then
notify-send -i /opt/apps/com.gitee.uengine.runner.spark/files/icon.png "未安装 UEngine结束" -a uengine-runner
exit
fi
notify-send -i /opt/apps/com.gitee.uengine.runner.spark/files/icon.png "UEngine 服务启动完成" -a uengine-runner
bad=0
# 守护进程,防止异常退出
while [[ true ]]; do
uengine session-manager -platformtheme=deepin
notify-send -i /opt/apps/com.gitee.uengine.runner.spark/files/icon.png "UEngine 服务异常结束,重新启动" -a uengine-runner
# 让用户可以强制结束
if [[ -f "/tmp/uengine-loading-ubuntu-end" ]]; then
rm /tmp/uengine-loading-ubuntu-end
echo UEngine 服务异常崩溃,不再重启服务
notify-send -i /opt/apps/com.gitee.uengine.runner.spark/files/icon.png "UEngine 服务异常崩溃,不再重启服务" -a uengine-runner
exit
fi
if [[ $bad -gt 9 ]]; then
# 错误次数太多,结束
notify-send -i /opt/apps/com.gitee.uengine.runner.spark/files/icon.png "UEngine 服务异常崩溃次数过多,不再重启服务" -a uengine-runner
echo UEngine 服务异常崩溃次数过多,不再重启服务
exit
fi
bad=$(($bad+1))
echo "UEngine 服务异常结束,重新启动($bad次"
notify-send -i /opt/apps/com.gitee.uengine.runner.spark/files/icon.png "UEngine 服务异常结束,重新启动($bad次" -a uengine-runner
done