可以使用以下shell脚本:
#!/bin/bash
检查程序是否启动
if pgrep -x "dotnet" > /dev/null then echo "程序已启动" else echo "程序未启动,正在启动" nohup dotnet > /dev/null & fi
可以使用以下shell脚本:
#!/bin/bash
if pgrep -x "dotnet" > /dev/null then echo "程序已启动" else echo "程序未启动,正在启动" nohup dotnet > /dev/null & fi