[GH-ISSUE #427] ./csgoserver: line 105: syntax error near unexpected token `}' #350

Closed
opened 2026-02-27 02:01:01 +03:00 by kerem · 5 comments
Owner

Originally created by @rand0med on GitHub (Jun 20, 2015).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/427

Hello,

I'm running a fully patched CentOS 6.6 64 bit server with all dependencies installed. I've setup a fresh VM with nothing else running on the box. I ran the csgoserver install script which completed without an issue. I ran the command ./csgoserver start and received the foillowing error:

./csgoserver: line 105: syntax error near unexpected token }' ./csgoserver: line 105:}'

Here is the full script File:

#!/bin/bash
# Counter Strike: Global Offensive
# Server Management Script
# Author: Daniel Gibbs
# Website: http://gameservermanagers.com
# Version: 090515

#### Variables ####

# Notification Email
# (on|off)
emailnotification="off"
email="example.com"

# Steam login
steamuser="anonymous"
steampass=""

# Start Variables
# https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server
# [Game Modes]           gametype    gamemode
# Arms Race                  1            0
# Classic Casual             0            0
# Classic Competitive        0            1
# Demolition                 1            1
# Deathmatch                 1            2
gamemode="1"
gametype="2"
defaultmap="de_train"
mapgroup="random_classic"
maxplayers="16"
tickrate="128"
port="27015"
sourcetvport="27020"
clientport="27005"
ip="0.0.0.0"
updateonstart="no"
# Optional: Workshop Parameters
# https://developer.valvesoftware.com/wiki/CSGO_Workshop_For_Server_Operators
# To get an authkey visit - http://steamcommunity.com/dev/apikey
# authkey=""
# ws_collection_id=""
# ws_start_map=""

# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server
fn_parms(){
parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_mode ${gamemode} +game_type ${gametype} +host_workshop_collection ${ws_collection_id} +workshop_start_map ${ws_start_map} -authkey ${authkey}"
}

#### Advanced Variables ####

# Steam
appid="740"

# Server Details
servicename="csgo-server"
gamename="Counter Strike: Global Offensive"
engine="source"

# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/csgo"
executabledir="${filesdir}"
executable="./srcds_run"
servercfgdir="${systemdir}/cfg"
servercfg="${servicename}.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
defaultcfg="${servercfgdir}/server.cfg"
backupdir="${rootdir}/backups"

# Logging
logdays="7"
gamelogdir="${systemdir}/logs"
scriptlogdir="${rootdir}/log/script"
consolelogdir="${rootdir}/log/console"

scriptlog="${scriptlogdir}/${servicename}-script.log"
consolelog="${consolelogdir}/${servicename}-console.log"
emaillog="${scriptlogdir}/${servicename}-email.log"

scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"

##### Script #####
# Do not edit

fn_runfunction(){
# Functions are downloaded and run with this function
if [ ! -f "${rootdir}/functions/${functionfile}" ]; then
    cd "${rootdir}"
    if [ ! -d "functions" ]; then
        mkdir functions
    fi
    cd functions
    echo -e "loading ${functionfile}...\c"
    wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45-
    chmod +x "${functionfile}"
    cd "${rootdir}"
    sleep 1
i
source "${rootdir}/functions/${functionfile}"
}

fn_functions(){
# Functions are defined in fn_functions.
functionfile="${FUNCNAME}"
fn_runfunction
}

fn_functions

getopt=$1
fn_getopt

The error seems to point to the } right after the fn_functions option, but I'm not sure what the issue is in order to solve. Please advise.

Originally created by @rand0med on GitHub (Jun 20, 2015). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/427 Hello, I'm running a fully patched CentOS 6.6 64 bit server with all dependencies installed. I've setup a fresh VM with nothing else running on the box. I ran the csgoserver install script which completed without an issue. I ran the command ./csgoserver start and received the foillowing error: ./csgoserver: line 105: syntax error near unexpected token `}' ./csgoserver: line 105:`}' Here is the full script File: ``` #!/bin/bash # Counter Strike: Global Offensive # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com # Version: 090515 #### Variables #### # Notification Email # (on|off) emailnotification="off" email="example.com" # Steam login steamuser="anonymous" steampass="" # Start Variables # https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server # [Game Modes] gametype gamemode # Arms Race 1 0 # Classic Casual 0 0 # Classic Competitive 0 1 # Demolition 1 1 # Deathmatch 1 2 gamemode="1" gametype="2" defaultmap="de_train" mapgroup="random_classic" maxplayers="16" tickrate="128" port="27015" sourcetvport="27020" clientport="27005" ip="0.0.0.0" updateonstart="no" # Optional: Workshop Parameters # https://developer.valvesoftware.com/wiki/CSGO_Workshop_For_Server_Operators # To get an authkey visit - http://steamcommunity.com/dev/apikey # authkey="" # ws_collection_id="" # ws_start_map="" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server fn_parms(){ parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_mode ${gamemode} +game_type ${gametype} +host_workshop_collection ${ws_collection_id} +workshop_start_map ${ws_start_map} -authkey ${authkey}" } #### Advanced Variables #### # Steam appid="740" # Server Details servicename="csgo-server" gamename="Counter Strike: Global Offensive" engine="source" # Directories rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" selfname="$(basename $0)" lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/csgo" executabledir="${filesdir}" executable="./srcds_run" servercfgdir="${systemdir}/cfg" servercfg="${servicename}.cfg" servercfgfullpath="${servercfgdir}/${servercfg}" defaultcfg="${servercfgdir}/server.cfg" backupdir="${rootdir}/backups" # Logging logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" emaillog="${scriptlogdir}/${servicename}-email.log" scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" ##### Script ##### # Do not edit fn_runfunction(){ # Functions are downloaded and run with this function if [ ! -f "${rootdir}/functions/${functionfile}" ]; then cd "${rootdir}" if [ ! -d "functions" ]; then mkdir functions fi cd functions echo -e "loading ${functionfile}...\c" wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- chmod +x "${functionfile}" cd "${rootdir}" sleep 1 i source "${rootdir}/functions/${functionfile}" } fn_functions(){ # Functions are defined in fn_functions. functionfile="${FUNCNAME}" fn_runfunction } fn_functions getopt=$1 fn_getopt ``` The error seems to point to the } right after the fn_functions option, but I'm not sure what the issue is in order to solve. Please advise.
kerem closed this issue 2026-02-27 02:01:02 +03:00
Author
Owner

@Scarsz commented on GitHub (Jun 25, 2015):

Redownload csgoserver. It looks to me like the version that you have has a misspelled "fi" in it, leaving just the I, but in the most latest server release that typo isn't there.

<!-- gh-comment-id:115212925 --> @Scarsz commented on GitHub (Jun 25, 2015): Redownload csgoserver. It looks to me like the version that you have has a misspelled "fi" in it, leaving just the I, but in the most latest server release that typo isn't there.
Author
Owner

@rand0med commented on GitHub (Jun 27, 2015):

Redownloaded the file. on first run it gave an error related to being a part of the tty group, which i fixed following the instructions, upon the second attempt at running i received another error. Pasting results:

[csgoserver@localhost ~]$ ./csgoserver start
loading fn_start...OK
loading fn_check_systemdir...OK
loading fn_check_ip...OK
loading fn_check_logs...OK
[ INFO ] Starting csgo-server: Applying 730 steam_appid.txt Fix.
loading fn_details_config...OK
loading fn_logs...OK
[ .... ] Starting csgo-server: onshosting.com CSGO Deathmatch 128 tickloading fn_check_tmux...OK
loading fn_check_steamcmd...OK
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
/home/csgoserver/functions/fn_start: line 119: [: : integer expression expected
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
/home/csgoserver/functions/fn_start: line 122: [: : integer expression expected
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
[ FAIL ] Starting csgo-server: Unable to start onshosting.com CSGO Deathmatch 128 tick: Tmux error:

Command
=================================
tmux new-session -d -s "csgo-server" "./srcds_run -game csgo -usercon -strictportbind -ip 172.16.1.103 -port 27015 +clientport 27005 +tv_port 27020 -tickrate 64 +map de_dust2 +servercfgfile csgo-server.cfg -maxplayers_override 16 +mapgroup random_classic +game_mode 0 +game_type 0 +host_workshop_collection  +workshop_start_map  -authkey "

Error
=================================
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

Fix
=================================
csgoserver is not part of the tty group.

        tty:x:5:

Run the following command with root privileges.

        usermod -G tty csgoserver

http://gameservermanagers.com/tmux-op-perm
[csgoserver@localhost ~]$ su root
Password:
[root@localhost csgoserver]#  usermod -G tty csgoserver
[root@localhost csgoserver]# su csgoserver
[csgoserver@localhost ~]$ ./csgoserver start
[ .... ] Starting csgo-server: onshosting.com CSGO Deathmatch 128 ticktmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
/home/csgoserver/functions/fn_start: line 119: [: : integer expression expected
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
/home/csgoserver/functions/fn_start: line 122: [: : integer expression expected
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
[ FAIL ] Starting csgo-server: Unable to start onshosting.com CSGO Deathmatch 128 tick: Tmux error:

Command
=================================
tmux new-session -d -s "csgo-server" "./srcds_run -game csgo -usercon -strictportbind -ip 172.16.1.103 -port 27015 +clientport 27005 +tv_port 27020 -tickrate 64 +map de_dust2 +servercfgfile csgo-server.cfg -maxplayers_override 16 +mapgroup random_classic +game_mode 0 +game_type 0 +host_workshop_collection  +workshop_start_map  -authkey "

Error
=================================
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

Fix
=================================
No known fix currently. Please log an issue.
http://gameservermanagers.com/issues

[csgoserver@localhost ~]$

Package libevent-1.4.13-4.el6.x86_64 already installed and latest version
Nothing to do
[root@localhost csgoserver]#
<!-- gh-comment-id:116144103 --> @rand0med commented on GitHub (Jun 27, 2015): Redownloaded the file. on first run it gave an error related to being a part of the tty group, which i fixed following the instructions, upon the second attempt at running i received another error. Pasting results: ``` [csgoserver@localhost ~]$ ./csgoserver start loading fn_start...OK loading fn_check_systemdir...OK loading fn_check_ip...OK loading fn_check_logs...OK [ INFO ] Starting csgo-server: Applying 730 steam_appid.txt Fix. loading fn_details_config...OK loading fn_logs...OK [ .... ] Starting csgo-server: onshosting.com CSGO Deathmatch 128 tickloading fn_check_tmux...OK loading fn_check_steamcmd...OK tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory /home/csgoserver/functions/fn_start: line 119: [: : integer expression expected tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory /home/csgoserver/functions/fn_start: line 122: [: : integer expression expected tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory [ FAIL ] Starting csgo-server: Unable to start onshosting.com CSGO Deathmatch 128 tick: Tmux error: Command ================================= tmux new-session -d -s "csgo-server" "./srcds_run -game csgo -usercon -strictportbind -ip 172.16.1.103 -port 27015 +clientport 27005 +tv_port 27020 -tickrate 64 +map de_dust2 +servercfgfile csgo-server.cfg -maxplayers_override 16 +mapgroup random_classic +game_mode 0 +game_type 0 +host_workshop_collection +workshop_start_map -authkey " Error ================================= tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory Fix ================================= csgoserver is not part of the tty group. tty:x:5: Run the following command with root privileges. usermod -G tty csgoserver http://gameservermanagers.com/tmux-op-perm ``` ``` [csgoserver@localhost ~]$ su root Password: [root@localhost csgoserver]# usermod -G tty csgoserver [root@localhost csgoserver]# su csgoserver ``` ``` [csgoserver@localhost ~]$ ./csgoserver start [ .... ] Starting csgo-server: onshosting.com CSGO Deathmatch 128 ticktmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory /home/csgoserver/functions/fn_start: line 119: [: : integer expression expected tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory /home/csgoserver/functions/fn_start: line 122: [: : integer expression expected tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory [ FAIL ] Starting csgo-server: Unable to start onshosting.com CSGO Deathmatch 128 tick: Tmux error: Command ================================= tmux new-session -d -s "csgo-server" "./srcds_run -game csgo -usercon -strictportbind -ip 172.16.1.103 -port 27015 +clientport 27005 +tv_port 27020 -tickrate 64 +map de_dust2 +servercfgfile csgo-server.cfg -maxplayers_override 16 +mapgroup random_classic +game_mode 0 +game_type 0 +host_workshop_collection +workshop_start_map -authkey " Error ================================= tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory Fix ================================= No known fix currently. Please log an issue. http://gameservermanagers.com/issues ``` ``` [csgoserver@localhost ~]$ Package libevent-1.4.13-4.el6.x86_64 already installed and latest version Nothing to do [root@localhost csgoserver]# ```
Author
Owner

@Scarsz commented on GitHub (Jun 28, 2015):

ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5

<!-- gh-comment-id:116354618 --> @Scarsz commented on GitHub (Jun 28, 2015): `ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5`
Author
Owner

@rand0med commented on GitHub (Jun 30, 2015):

[csgoserver@localhost root]$ su root
Password:
[root@localhost ~]# ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2 .0.so.5
[root@localhost ~]# su csgoserver
[csgoserver@localhost root]$ cd /home/csgoserver/
[csgoserver@localhost ~]$ ./csgoserver start
[ OK ] Starting csgo-server: onshosting.com CSGO Deathmatch 128 tick

Looks like creating the symbolic link worked. Thanks!

<!-- gh-comment-id:116882656 --> @rand0med commented on GitHub (Jun 30, 2015): [csgoserver@localhost root]$ su root Password: [root@localhost ~]# ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2 .0.so.5 [root@localhost ~]# su csgoserver [csgoserver@localhost root]$ cd /home/csgoserver/ [csgoserver@localhost ~]$ ./csgoserver start [ OK ] Starting csgo-server: onshosting.com CSGO Deathmatch 128 tick Looks like creating the symbolic link worked. Thanks!
Author
Owner

@lock[bot] commented on GitHub (Jul 19, 2018):

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

<!-- gh-comment-id:406399923 --> @lock[bot] commented on GitHub (Jul 19, 2018): This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Sign in to join this conversation.
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LinuxGSM#350
No description provided.