Merge branch 'master' of http://git.legu.cc/liwei_3d/dfbattle
This commit is contained in:
commit
edaf6c73e6
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
3
start.sh
Normal file
3
start.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
./stup.sh start ./output/dfbattle.dll ws://127.0.0.1:9897
|
||||||
|
sleep 1
|
||||||
|
exit
|
3
stop.sh
Normal file
3
stop.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
./stup.sh stop ./output/dfbattle.dll ws://127.0.0.1:9897
|
||||||
|
sleep 1
|
||||||
|
exit
|
61
stup.sh
Normal file
61
stup.sh
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SERVICE="$2 $3"
|
||||||
|
CMD="dotnet $2 $3"
|
||||||
|
CMD2=$2
|
||||||
|
CMD3=$3
|
||||||
|
start(){
|
||||||
|
echo "starting $SERVICE..."
|
||||||
|
num=`ps -ef | grep dotnet | grep $CMD2 | grep $CMD3 |grep -v grep | grep -v /bin/bash | wc -l`
|
||||||
|
if [ $num -eq 0 ]
|
||||||
|
then
|
||||||
|
# nohup $CMD > /dev/null 2>&1 &
|
||||||
|
nohup $CMD > s.log 2>&1 &
|
||||||
|
if [ $? -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "start failed, please check the log!"
|
||||||
|
exit $?
|
||||||
|
else
|
||||||
|
|
||||||
|
# echo $! > $SERVICE.pid
|
||||||
|
echo "start success"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "$SERVICE is already running"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
stop(){
|
||||||
|
echo "stopping $SERVICE..."
|
||||||
|
#kill -9 `cat $SERVICE.pid`
|
||||||
|
kill -9 `ps -ef | grep dotnet | grep $CMD2 | grep $CMD3 | awk '{print $2}'`
|
||||||
|
if [ $? -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "stop failed, may be $SERVICE isn't running"
|
||||||
|
exit $?
|
||||||
|
else
|
||||||
|
#rm -rf $SERVICE.pid
|
||||||
|
echo "stop success"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
restart(){
|
||||||
|
stop&&start
|
||||||
|
}
|
||||||
|
status(){
|
||||||
|
num=`ps -ef | grep dotnet | grep $CMD2 || grep $CMD3 | grep -v grep | wc -l`
|
||||||
|
if [ $num -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "$SERVICE isn't running"
|
||||||
|
else
|
||||||
|
echo "$SERVICE is running"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
case $1 in
|
||||||
|
start) start ;;
|
||||||
|
stop) stop ;;
|
||||||
|
restart) restart ;;
|
||||||
|
status) status ;;
|
||||||
|
*) echo "Usage: $0 {start|stop|restart|status}" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Reference in New Issue
Block a user