我有一个在系统首次启动时运行的脚本。但是第二次使用相同的脚本也只跳过一个命令。
所以我尝试使用变量,但似乎没有办法跟踪它。
例如:/var/tmp/runme.sh
<< 使用相同的脚本
#!/bin/bash
mkfifo pipe;
mkfifo pipe1;
ps aux | grep Java.jar | awk '{print $2}' | xargs kill -9;
sleep 1;
#
# Question on this:
# only one time it execute / its my application boot process
# - this is only one time on system startup
#
##############################################################
export DISPLAY=:0.0 && java -cp Java.jar main.Boot &
#
# second time this following should always execute
# This is my software kernel, which crash often
# on the fly i restart it
#
while true; do cat /var/jpeg1.jpeg >> pipe; done
while true; do cat /var/jpeg2.jpeg >> pipe1; done
export DISPLAY=:0.0 && java -cp Java.jar main.Desktop &