From 24a6546989780a8478a8f6b339236eccd5e13958 Mon Sep 17 00:00:00 2001 From: lenosisnickerboa Date: Mon, 7 Jan 2019 21:18:32 +0100 Subject: [PATCH] linux: One more attempt to fix the start/stop script bugging a few users --- src/linux/server.sh | 14 ++++++++------ src/version.tcl | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/linux/server.sh b/src/linux/server.sh index 8188abc..cc95d33 100755 --- a/src/linux/server.sh +++ b/src/linux/server.sh @@ -4,7 +4,7 @@ full_path=`dirname "$(readlink -f "$0")"` full_path_srcds=`dirname "$full_path"`/server function status_ext() { - local pids=`pgrep $1` + local pids=`pgrep -f "$1"` [ -z "$pids" ] && return 1 local pidline=`pwdx $pids | grep "$full_path_srcds"` [ -z "$pidline" ] && return 1 @@ -19,22 +19,24 @@ fullcommand="$1" ; shift fulldir="`dirname \"$fullcommand\"`" lastdir="`basename \"$fulldir\"`" command="`basename \"$fullcommand\"`" -usecommand="$lastdir/$command" +#usecommand="$lastdir/$command" +usecommand="./$command" -cd "$fulldir/.." +#cd "$fulldir/.." +cd "$fulldir" case "$action" in start) - "$usecommand" "$@" & + sh "$usecommand" "$@" & ;; autorestart) while : ; do - "$usecommand" "$@" & + sh "$usecommand" "$@" & echo Server was stopped or crashed, restarting... done ;; stop) - pid1=`status_ext srcds_run` + pid1=`status_ext "sh ./srcds_run"` pid2=`status_ext srcds_linux` [ ! -z "$pid1$pid2" ] && kill -s SIGHUP $pid1 $pid2 ;; diff --git a/src/version.tcl b/src/version.tcl index 7ff5f6d..b9501c1 100755 --- a/src/version.tcl +++ b/src/version.tcl @@ -3,4 +3,4 @@ # The next line is executed by /bin/sh, but not tcl \ exec wish "$0" ${1+"$@"} -set version "2.6.5" +set version "2.6.6"