Skip to content
Snippets Groups Projects
Commit 1571390b authored by Pete Jemian's avatar Pete Jemian
Browse files

when comparing strings in bash shell, wrap in quotes

parent a9107445
No related branches found
No related tags found
No related merge requests found
...@@ -78,14 +78,14 @@ checkpid() { ...@@ -78,14 +78,14 @@ checkpid() {
BIN_CWD=`${READLINK} /proc/${pid}/cwd` BIN_CWD=`${READLINK} /proc/${pid}/cwd`
IOC_CWD=`${READLINK} -f ${IOC_STARTUP_DIR}` IOC_CWD=`${READLINK} -f ${IOC_STARTUP_DIR}`
if [ $BIN_CWD == $IOC_CWD ] ; then if [ "$BIN_CWD" == "$IOC_CWD" ] ; then
# The IOC is running; the binary with PID=$pid is the IOC that was run from $IOC_STARTUP_DIR # The IOC is running; the binary with PID=$pid is the IOC that was run from $IOC_STARTUP_DIR
IOC_PID=${pid} IOC_PID=${pid}
IOC_DOWN=0 IOC_DOWN=0
SCREEN_PID="" SCREEN_PID=""
if [ ${GET_SCREEN_PID} == "YES" ] if [ "${GET_SCREEN_PID}" == "YES" ]
then then
# Get the PID of the parent of the IOC (shell or screen) # Get the PID of the parent of the IOC (shell or screen)
P_PID=`${PS} -p ${IOC_PID} -o ppid=` P_PID=`${PS} -p ${IOC_PID} -o ppid=`
...@@ -102,12 +102,12 @@ checkpid() { ...@@ -102,12 +102,12 @@ checkpid() {
do do
#!${ECHO} ${s_pid} #!${ECHO} ${s_pid}
if [ ${s_pid} == ${P_PID} ] ; then if [ "${s_pid}" == "${P_PID}" ] ; then
SCREEN_PID=${s_pid} SCREEN_PID=${s_pid}
break break
fi fi
if [ ${s_pid} == ${GP_PID} ] ; then if [ "${s_pid}" == "${GP_PID}" ] ; then
SCREEN_PID=${s_pid} SCREEN_PID=${s_pid}
break break
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment