📄 run_app.sh.txt
字号:
#!/bin/sh
# ----------------------------------------
# Begin of runtime setting here,
#
APP_PATH=/home/test
APP_NAME=test.out
#
# End of runtime setting.
# ----------------------------------------
case $1 in
'start')
PID=`ps -fu ${LOGNAME} | grep $APP_NAME | grep -v grep | awk '{print $2}'`
if [ "X$PID" != "X" ]
then
echo "WARNIG: Cannot start already-running instance - shut it down first.[PID=$PID]"
else
# -----------------------------------------
# Begin of run command here,
#
$APP_PATH/./$APP_NAME &
#
# End of run command.
# -----------------------------------------
PID=`ps -fu ${LOGNAME} | grep $APP_NAME | grep -v grep | awk '{print $2}'`
if [ "X$PID" != "X" ]
then
echo "Start ok.[PID=$PID]"
else
echo "Start failed."
exit -1
fi
fi
;;
'stop')
PID=`ps -fu ${LOGNAME} | grep $APP_NAME | grep -v grep | awk '{print $2}'`
if [ "X$PID" != "X" ]
then
kill -9 $PID
echo "Stop ok.[PID=$PID]"
fi
;;
'status')
PID=`ps -fu ${LOGNAME} | grep $APP_NAME | grep -v grep | awk '{print $2}'`
if [ "X$PID" != "X" ]
then
echo "It's running.[PID=$PID]"
else
echo "It's not running."
fi
;;
'restart')
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 { start | stop | status | restart | help }"
;;
esac
exit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -