[PATCH] corrected test syntax in sslh init script

Signed-off-by: Matthias Buecher <mail@maddes.net>


git-svn-id: svn://svn.openwrt.org/openwrt/packages@17108 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2009-08-03 20:26:28 +00:00
parent 46c42e7b2d
commit 6f14dcb279

View File

@ -13,7 +13,7 @@ sslh_start()
# check if section is enabled (default) # check if section is enabled (default)
local enabled local enabled
config_get_bool enabled "${section}" enable 1 config_get_bool enabled "${section}" enable 1
[ ${enabled} -eq 0 ] && return 1 [ "${enabled}" -eq 0 ] && return 1
# increase pid file count to handle multiple instances correctly # increase pid file count to handle multiple instances correctly
PIDCOUNT="$(( ${PIDCOUNT} + 1 ))" PIDCOUNT="$(( ${PIDCOUNT} + 1 ))"
@ -23,23 +23,23 @@ sslh_start()
local val local val
# A) listen parameter # A) listen parameter
config_get val "${section}" listen config_get val "${section}" listen
[ ! -z ${val} ] && append args "-p ${val}" [ ! -z "${val}" ] && append args "-p ${val}"
# B) ssh parameter # B) ssh parameter
config_get val "${section}" ssh config_get val "${section}" ssh
[ ! -z ${val} ] && append args "-s ${val}" [ ! -z "${val}" ] && append args "-s ${val}"
# C) ssl parameter # C) ssl parameter
config_get val "${section}" ssl config_get val "${section}" ssl
[ ! -z ${val} ] && append args "-l ${val}" [ ! -z "${val}" ] && append args "-l ${val}"
# D) timeout (for ssh, then ssl is assumed) # D) timeout (for ssh, then ssl is assumed)
config_get val "${section}" timeout config_get val "${section}" timeout
[ ! -z ${val} ] && append args "-t ${val}" [ ! -z "${val}" ] && append args "-t ${val}"
# E) verbose parameter # E) verbose parameter
local verbosed local verbosed
config_get_bool verbosed "${section}" verbose 0 config_get_bool verbosed "${section}" verbose 0
[ ${verbosed} -ne 0 ] && append args "-v" [ "${verbosed}" -ne 0 ] && append args "-v"
# execute program and return its exit code # execute program and return its exit code
[ ${verbosed} -ne 0 ] && echo "${NAME}: section ${section} starting ${PROG} ${args}" [ "${verbosed}" -ne 0 ] && echo "${NAME}: section ${section} starting ${PROG} ${args}"
${PROG} ${args} ${PROG} ${args}
return $? return $?
} }
@ -70,7 +70,7 @@ stop()
for pid in `pidof sslh` for pid in `pidof sslh`
do do
# check if correct program # check if correct program
ps | grep ${pid} | grep ${PROG} >/dev/null ps | grep "${pid}" | grep "${PROG}" >/dev/null
[ $? -ne 0 ] && continue [ $? -ne 0 ] && continue
# kill process # kill process