Skip to content

Commit

Permalink
linux: One more attempt to fix the start/stop script bugging a few users
Browse files Browse the repository at this point in the history
  • Loading branch information
lenosisnickerboa committed Jan 7, 2019
1 parent 87091ba commit 24a6546
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/linux/server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
;;
Expand Down
2 changes: 1 addition & 1 deletion src/version.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 24a6546

Please sign in to comment.