LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-09-2003, 10:38 PM   #1
jimmorrison
LQ Newbie
 
Registered: Apr 2003
Posts: 2

Rep: Reputation: 0
basic script help required


Hi

I need to write/right a basic script. (like a windows .bat)

i need it to run these commands which I have saved in a file called cs.sh

cd /
cd /halflife
cd /hlds_l
./hlds_run -game cstrike -insecure -nomaster +maxplayers 16 +map cs_assault +sv_lan 1

when I type in sh cs.sh
it will not run.
The output from the console is

cs.sh: cd: /hlds_l: No such file or directory
cs.sh:cd: /hlds_run: No such file or directory

I am positive the dir names are correct

whats wrong?
 
Old 04-09-2003, 11:04 PM   #2
rmartine
Member
 
Registered: Dec 2002
Location: San Luis Obispo, CA
Distribution: Fedora Core 3
Posts: 618

Rep: Reputation: 30
try this.

#!/bin/sh

/halflife/hlds_l/hlds_run -game cstrike -insecure -nomaster +maxplayers 16 +map cs_assault +sv_lan 1

Just give the full path. Make it executable and off you go.

Good Luck
 
Old 04-09-2003, 11:07 PM   #3
born4linux
Senior Member
 
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
#!/bin/sh

./hlds_run -game cstrike -insecure -nomaster +maxplayers 16 +map cs_assault +sv_lan 1

then save the file (say /hlds_l/start.sh)

then do a chmod +x /hdls_l/start.sh

then cd into /hlds_l and type this:

./start.sh

NOTE: as cs serverr tutorial suggests - DON'T RUN THE HL SERVER AS USER ROOT!.
 
Old 04-09-2003, 11:35 PM   #4
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
Quote:
cd /
cd /halflife
cd /hlds_l
looks like the original problem was here. I though someone should clarify it, so you don't make the same mistake.

first of all, you can enter more than one directory, eg.
cd /halflife/hlds_l

But if you decide to do it otherwise:
/ always means root.

so if you go:
cd /hlds_l
it looks for hlds_l under / (while it seems it exists under /halflife/hlds_l)

so either, if you're already in the directory (ie. /halflife_ you can just enter:
cd hlds_l

or, you can use './' which means the directory you are in now, eg.
cd ./hlds_l

you really don't want to run it as root.
; )
 
Old 04-10-2003, 05:55 AM   #5
jimmorrison
LQ Newbie
 
Registered: Apr 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks alot for the help guys. I am new to linux so I expected running as root would be easier.

I will set it up as a normal user in the next couplee days.

Thanks again
 
Old 10-26-2004, 11:31 PM   #6
LtcJohnson
LQ Newbie
 
Registered: Sep 2004
Distribution: What say you?
Posts: 6

Rep: Reputation: 0
This is a little better

Doing it this way here will enable you do place the script file whereever you'd like it to be.

Code:
#!/bin/bash
cd /path/to/hlds_l ;
screen -A -m -d -S hlds ./hlds_run -game cstrike +ip 66.235.183.203 +port 27016 +maxplayers 30 +map cs_assault_upc -autoupdate ;
The whole screen thing is so you can close the terminal or whatever. to resume it you do screen -r hlds and to detach the screen ctr-a then d

That is what I use for one of my servers. But if you only run 1 server this link would be great for you. It doesnt work well for me because i run 6 servers.

http://www.counter-strike.de/content/server/hlds_start

Last edited by LtcJohnson; 10-26-2004 at 11:34 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Monitoring Script required nimish Linux - Software 0 11-05-2004 03:25 AM
minimum space required for basic RedHat Linux Enterprise V3 installation qbsu21th Red Hat 4 10-21-2004 11:14 AM
Help required on some basic Questions on Linux lionelx Linux - Software 8 09-27-2004 01:56 PM
New Firewall Script Required smurf Linux - Networking 1 06-10-2004 07:29 AM
some very basic information required sixth_sense Linux - Newbie 2 04-18-2004 12:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration