File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,18 +160,6 @@ do_trap() {
160160
161161trap do_trap INT TERM
162162
163-
164- check_process_running () {
165- if [ " $ps_grep " = " " ]
166- then
167- ps -p " $server_pid " > /dev/null
168- PS_EXIT=$?
169- else
170- pgrep -f " ^ *$server_pid " > /dev/null
171- PS_EXIT=$?
172- fi
173- }
174-
175163#
176164# Start an OpenSSL server
177165#
@@ -218,8 +206,7 @@ start_openssl_server() {
218206 # wait to see if s_server successfully starts before continuing
219207 sleep 0.1
220208
221- check_process_running
222- if [ " $PS_EXIT " = " 0" ]
209+ if kill -0 " $server_pid " 2> /dev/null
223210 then
224211 echo " s_server started successfully on port $server_port "
225212 found_free_port=1
@@ -283,8 +270,7 @@ start_wolfssl_server() {
283270 # wait to see if server successfully starts before continuing
284271 sleep 0.1
285272
286- check_process_running
287- if [ " $PS_EXIT " = " 0" ]
273+ if kill -0 " $server_pid " 2> /dev/null
288274 then
289275 echo " wolfSSL server started successfully on port $server_port "
290276 found_free_port=1
@@ -463,11 +449,6 @@ echo "OpenSSL version:"
463449$OPENSSL version -a
464450echo
465451
466- if ! ps -p $PPID > /dev/null 2>&1 ; then
467- ps_grep=" yes"
468- echo " ps -p not working, using ps and grep"
469- fi
470-
471452echo -e " \nTesting existence of openssl command...\n"
472453command -v " $OPENSSL " > /dev/null 2>&1 || { echo >&2 " Requires openssl command, but it's not installed. Ending." ; do_cleanup; exit 0; }
473454
You can’t perform that action at this time.
0 commit comments