You are not logged in.

Dear visitor, welcome to sourceserver.info. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, March 12th 2010, 11:28pm

Kleines prob mit dem SRCDS file und neuem root! ^^

Hi ich helfe gerade nem kumpel nen gameserver zu installieren auf seinem Debian Linux rootserver und dabei bin ich auf ein kleines prob gestoßen bei dem ich mal wieder eure fachmännische hilfe gebrauchen könnte! ^^

und zwar wenn ich versuche den server mittels ./srcds start zu starten schmeißt mir der werte server nur folgende fehlermeldung raus:

Source code

1
2
3
4
5
6
7
8
9
10
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
'/srcds: line 76: syntax error near unexpected token `{
'/srcds: line 76: `start() {


Screen, und das komplette awk package sind installiert also original-awk, gawk und mawk
aber trotzdem bleibt es bei diesem netten fehler jemand nen plan was ich vergessen habe könnte?? Würde mich über hilfe freun! ^^

Gruß Viper2

Impact

Super Moderator

Posts: 1,276

wcf.user.option.userOption53: Nein

  • Send private message

2

Friday, March 12th 2010, 11:34pm

Re: Kleines prob mit dem SRCDS file und neuem root! ^^

versuchs mal mit

./srcds_run -game .....

Mfg
Impact

3

Friday, March 12th 2010, 11:36pm

Re: Kleines prob mit dem SRCDS file und neuem root! ^^

das is kein problem mit diesem befehl geht es das kenn ich ja aber es muss ja auch mit ./srcds start gehn ich hab ja extra das srcds script drauf gemacht damit man sich diesen umständlichen befehl sparen kann! ^^

MadMakz

Super Moderator

Posts: 1,878

Location: ~#

wcf.user.option.userOption53: Ja

  • Send private message

4

Saturday, March 13th 2010, 12:31am

Re: Kleines prob mit dem SRCDS file und neuem root! ^^

falsche shell? überprüfe mal die shebang zeile, für die unix shell sollte dort #!/bin/sh (oder #!/usr/bin/sh, je nach distro) stehen (tip; "whereis" nutzen).
wenn es ein perl script ist dann wäre es #!/bin/perl bzw. #!/usr/bin/perl etc.
andernfalls auch nochmal überprüfen ob nicht ein endtag oder " im script vergessen wurden oder zuviel sind.

edit: habe mal ein bischen gegoogelt da du awk erwähnt hast und im fall das das script auch ein awk script ist sollte die shebang zeile #!/usr/bin/awk -f sein, soweit ich das sehe. es kann auch sein das der pfad innerhalb der distros unterschiedlich ist und deshalb dein script scheitert
ein

Source code

1
whereis -b awk
sollte hier abhilfe schaffen.

Impact

Super Moderator

Posts: 1,276

wcf.user.option.userOption53: Nein

  • Send private message

5

Saturday, March 13th 2010, 1:08am

Re: Kleines prob mit dem SRCDS file und neuem root! ^^

oder lad die srcds mal hoch =)

6

Saturday, March 13th 2010, 3:12am

Re: Kleines prob mit dem SRCDS file und neuem root! ^^

Das script müsste doch eigentlich bekannt sein naja hier nochmal gepostet! ^^

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# /bin/bash
#
# Start the Counter-Strike: Source dedicated server.
#
# AUTHORS :
#
# Julien Escario ( pandemik@azilog.net )
# &
# Cedric Rochat ( crochat@younics.org )
# &
# Cmdr._Firewalker ( cmdr._firewalker@web.de )
#
# ===========================================
#
# What you need:
#
# Linux :)
# awk
# screen
# the srcds_l & cstrike files (obtainable via steam)
#
# How to use:
#
# Edit the CS_USER-Var to the user running your cs-servers
# Edit the DIR-Var to fit your system (just contains the path to the dir that contains srcds_run)
# Edit the PARAMS-Var to fit your needs
# - standard is startup as internet server
# if you use multiple scripts on one system you should change the NAME-var (otherwise  
#   all will be stopped if you run the script with "stop", and status will be useless)
#
# When this is done, copy the file to /etc/rc.d/init.d (or whereever your system stores the
# scripts for starting the services) and set the execute permission.
# Now you can link the script to your runlevel-dir, here's an example for runlevel 3:
# ln -s /etc/rc.d/init.d/srcds /etc/rc.d/rc3.d/S90srcds
# ln -s /etc/rc.d/init.d/srcds /etc/rc.d/rc3.d/K50srcds
# or use update-rc.d if you got a system using that tool (like Debian, see manpage)
#
# Or use it manually like:
# ./srcds start
# ./srcds stop
#
# To see the server-console start the script with the parameter "watch".
#
# DOC by jwm (jwm@counter-strike.de)

# !!!!!!!!!!!!!! CHANGE THIS TO THE USER YOU USE FOR YOUR SERVER !!!!!!!!!!!!!!!
CS_USER=csspublic

PATH=/bin:/usr/bin:/sbin:/usr/sbin

# # DON'T FORGET TO CHANGE THE PATH TO YOUR NEEDS!
DIR=/home/csspublic/srcds

DAEMON=srcds_run

# LAN server:
# PARAMS="-game cstrike -nomaster -insecure +sv_lan 1 +maxplayers 16 +map de_dust"
# Internet server:
PARAMS="-game cstrike +map de_dust2 +maxplayers 30 +ip 213.239.241.31 -port 27015 -autoupdate -tickrate 100"

NAME=csspublic
DESC="Public Server"

# No edits (should be) necessary beyond this line

if [ ! -x `which awk` ]; then echo "You need awk for this script"; exit 1; fi
if [ ! -x `which screen` ]; then echo "You need screen (the program, moron!) for this script"; exit 1; fi

if [ `whoami` = root ]
then
 usagetype=root
else
 usagetype=nonroot
fi

start() {
   if [ ! -d $DIR ]; then echo " ... No such directory: $DIR!";  exit 1; fi
   if [ ! -x $DIR/$DAEMON ]; then echo "$DIR/$DAEMON does not exist or is not executable!"; exit 1; fi
   if status; then echo " ... $DESC: $NAME is already running!"; exit 1; fi

   case "$usagetype" in
   root)
    su - $CS_USER -c "cd $DIR ; screen -AmdS $NAME ./$DAEMON $PARAMS"
   ;;
   nonroot)
    cd $DIR ; screen -AmdS $NAME ./$DAEMON $PARAMS
   ;;
   esac

}

stop () {
   if ! status; then echo " ... $DESC $NAME could not be found. Probably not running."; exit 1; fi

   case "$usagetype" in
   root)
    tmp=$(su - $CS_USER -c "screen -ls" | awk -F . "\$2 ~ /^$NAME[[:space:]].*/ {print \$1}" | awk '{print $1}')
    su - $CS_USER -c "screen -r $tmp -X quit"
   ;;
   nonroot)
    screen -r $(screen -ls | awk -F . "\$2 ~ /^$NAME[[:space:]].*/ {print \$1}" | awk '{print $1}') -X quit
   ;;
   esac
}

status () {
   case "$usagetype" in
   root)
    su - $CS_USER -c "screen -ls" | grep [.]$NAME[[:space:]] > /dev/null
   ;;
   nonroot)
    screen -ls | grep [.]$NAME[[:space:]] > /dev/null
   ;;
   esac
}

watch () {
   if ! status; then echo "$DESC $NAME could not be found. Probably not running."; exit 1; fi

   case "$usagetype" in
   root)
    tmp=$(su - $CS_USER -c "screen -ls" | awk -F . "\$2 ~ /^$NAME[[:space:]].*/ {print \$1}" | awk '{print $1}')
    su - $CS_USER -c "screen -r $tmp"
   ;;
   nonroot)
    screen -r $(screen -ls | awk -F . "\$2 ~ /^$NAME[[:space:]].*/ {print \$1}" | awk '{print $1}')
   ;;
   esac
}

case "$1" in
 start)
  echo "Starting $DESC: $NAME"
  start
  echo " ... done."
 ;;

 stop)
  echo "Stopping $DESC: $NAME"
  stop
  echo " ... done."
 ;;

 restart)
  echo "Restarting $DESC: $NAME"
  status && stop
  sleep 20
  start
  echo " ... done."
 ;;

 status)
  if status
  then echo "$DESC: $NAME is UP" 
  else echo "$DESC: $NAME is DOWN"
  fi
 ;;
 watch)
  watch
 ;;

 *)
   echo "Usage: $0 {start|stop|status|restart|watch}\nWhile watching press ctrl-a, ctrl-d to stop watching without stopping the server."
   exit 1
   ;;

esac


exit 0


das is das komplette script und eigentlich muss das auch funzen hab es ja ne zeitlang bis ich zu nem webinterface umgestiegen bin auf meinem Server auch genutzt!

7

Sunday, March 14th 2010, 5:09pm

Re: Kleines prob mit dem SRCDS file und neuem root! ^^

Pls help! ^^

rain

Super Moderator

Posts: 1,410

Location: Lutherstadt Wittenberg

Occupation: Anlagenmechaniker

wcf.user.option.userOption53: Ja

  • Send private message

8

Sunday, March 14th 2010, 5:13pm

Re: Kleines prob mit dem SRCDS file und neuem root! ^^

hast eine PM





9

Sunday, March 14th 2010, 7:10pm

Re: Kleines prob mit dem SRCDS file und neuem root! ^^

Klasse danke dir rain nochmals für die hilfe! ^^

DeaD_EyE

Administrator

Posts: 3,980

Location: Hagen

Occupation: Mechatroniker (didaktische Systeme)

wcf.user.option.userOption53: Nein

  • Send private message

10

Sunday, March 14th 2010, 7:17pm

Re: Kleines prob mit dem SRCDS file und neuem root! ^^

Woran lags?
Wär ganz gut für andere, die das gleiche Problem haben. Die kommen dann zwar mit google auf diesen Beitrag, geholfen wird ihnen damit trotzdem nicht.

rain

Super Moderator

Posts: 1,410

Location: Lutherstadt Wittenberg

Occupation: Anlagenmechaniker

wcf.user.option.userOption53: Ja

  • Send private message

11

Sunday, March 14th 2010, 7:32pm

Re: Kleines prob mit dem SRCDS file und neuem root! ^^

zeile

Source code

1
2
3
4
start() {
   if [ ! -d $DIR ]; then echo " ... No such directory: $DIR!";  exit 1; fi
   if [ ! -x $DIR/$DAEMON ]; then echo "$DIR/$DAEMON does not exist or is not executable!"; exit 1; fi
   if status; then echo " ... $DESC: $NAME is already running!"; exit 1; fi


hat ein leerzeichen bei start() { gefehlt. Es hätte start () { sein müssen

^^ kleiner fehler große Wirkung





DeaD_EyE

Administrator

Posts: 3,980

Location: Hagen

Occupation: Mechatroniker (didaktische Systeme)

wcf.user.option.userOption53: Nein

  • Send private message

12

Monday, March 15th 2010, 10:02pm

Re: Kleines prob mit dem SRCDS file und neuem root! ^^

Bisschen eingenartig. Das ist mir auch als erstes aufgefallen. In einem Testscript funktionierte die Funktion aber dennoch ohne Fehlermeldungen.
Die Bash scheint von Version zu Version Fehlertoleranter zu werden. Anders kann ich mir das nicht erklären.

MadMakz

Super Moderator

Posts: 1,878

Location: ~#

wcf.user.option.userOption53: Ja

  • Send private message

13

Tuesday, March 16th 2010, 2:15am

Re: Kleines prob mit dem SRCDS file und neuem root! ^^

windows notepad ist mal wieder schuld. konnte es 1A reproduzieren.
also, umstieg auf pspad (o. ä.) angesagt; und darauf achten das das formating auf unix steht.
alternativ gibt es noch das linux proggie dos2unix (= packetname) wo man seine textfiles vorher durchjagen kann.

jedenfalls ist windows notepad ein "no go" für linux.

DeaD_EyE

Administrator

Posts: 3,980

Location: Hagen

Occupation: Mechatroniker (didaktische Systeme)

wcf.user.option.userOption53: Nein

  • Send private message

14

Tuesday, March 16th 2010, 4:21pm

Re: Kleines prob mit dem SRCDS file und neuem root! ^^

Beim Datentransfer im ASCII-Modus über FTP werden die Steuerzeichen ^M (CR) entfernt.
Ich nutze seit langem Notepad++. Der Editor ist sehr zu empfehlen.