In order to be able to surf the internet scientifically, you know. It is necessary to boot the service terminal. However, the script runs normally under the secure CRT and is added to/etc/rc.local but does not start the service properly. Using PS to find the next, the script is running, but the service is not up. So toss a pass, doubt is not the path can not find the reason. The export of the path, however, was duly completed.
Original script
#! /bin/SH#进程名字可修改PRO_NAME=Ssserverport=don't tell you pass=Don't tell you while true; Do#用ps获取 $PRO Number of _name processes NUM=`PSAux |grep${pro_name} |grep-Vgrep|WC-l ' #Echo "PS aux | grep ${pro_name} | grep-v grep |wc-l" #Echo$NUM #小于1, restart the processif["${num}"-lt"1"]; Then Echo "${pro_name} was killed"${pro_name}-P ${port}-K ${pass}-M aes- the-CFB--user Nobody-d startfi DoneExit0
The modified script
#! /bin/SH#进程名字可修改PRO_NAME=Ssserverport=want to tell you, pass?=I'm still not telling you. Export PATH="$PATH" while true; Do#用ps获取 $PRO Number of _name processes NUM=`PSAux |grep${pro_name} |grep-Vgrep|WC-l ' #Echo "PS aux | grep ${pro_name} | grep-v grep |wc-l" #Echo$NUM #小于1, restart the processif["${num}"-lt"1"]; Then Echo "${pro_name} was killed"${pro_name}-P ${port}-K ${pass}-M aes- the-CFB--user Nobody-d startfi DoneExit0
The internet goes on gracefully and scientifically, and the wall no longer.
Linux custom scripts added to the rc.local script does not work correctly