small shell script for Linux users

Post anything to do with editing Nexuiz here. Whether its problems you've had, questions, or if you just want to show off your work.

Moderators: Nexuiz Moderators, Moderators

small shell script for Linux users

Postby Crashzor » Wed Apr 05, 2006 4:51 pm

For you how don't understand it put it in a file .sh
chmod 777 the file.
Type ./the file name server ip.
it will auto record a demo name of the demo will be
you're nickname ( or what ever you put in the script )_the time stamp
Its shot its simple and is handy for ladder matches

#change the nickname
nickname="change me";
#do noting here
date=$(date +"%Y%m%d%H%M");
./nexuiz-linux-686-sdl -sndstereo +record $nickname_$date +connect $1


don't know if it already hase been made or posted here
Crashzor
Member
 
Posts: 15
Joined: Sat Apr 01, 2006 8:24 pm

Postby esteel » Wed Apr 05, 2006 4:59 pm

Would you have read all the PMs i wrote to you, you would have noticed this link: http://www.forums.alientrap.local/viewtopic.php?p=92#92 :) ;)
Oh and telling people to chmod 0777 a file is just bad.. 0755 would be more like it.. at least for those people that keep an eye on security!
Last edited by esteel on Thu Aug 31, 2006 7:42 pm, edited 1 time in total.
esteel
Site admin and forum addon
 
Posts: 3924
Joined: Wed Mar 01, 2006 8:27 am

Postby Crashzor » Wed Apr 05, 2006 5:03 pm

o you're right about the chmod and i just notice the pm.
sorry litler error you can remove this thread :lol:
Crashzor
Member
 
Posts: 15
Joined: Sat Apr 01, 2006 8:24 pm

Postby esteel » Wed Apr 05, 2006 5:07 pm

Nah.. maybe that way people find out about autorecord easier :)
Last edited by esteel on Thu Aug 31, 2006 7:42 pm, edited 1 time in total.
esteel
Site admin and forum addon
 
Posts: 3924
Joined: Wed Mar 01, 2006 8:27 am

Postby KadaverJack » Wed Apr 05, 2006 6:29 pm

btw: Nexuiz 1.6 will have automatic demo recording as engine feature (the cvars are cl_autodemo and cl_autodemo_nameformat) :)
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm

Postby esteel » Wed Apr 05, 2006 7:20 pm

Guess i have to follow the DP cvs more closely.. does this also mean in-game record-starting does work?? But autorecording allone is great!
Last edited by esteel on Thu Aug 31, 2006 7:43 pm, edited 1 time in total.
esteel
Site admin and forum addon
 
Posts: 3924
Joined: Wed Mar 01, 2006 8:27 am

Postby KadaverJack » Wed Apr 05, 2006 7:35 pm

esteel wrote:does this also mean in-game record-starting does work??

No. But the enigne autorecording has the advantage, that you can switch servers and it will start a new demo automagically.
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm

Postby esteel » Thu Apr 06, 2006 8:41 am

Yeah thats true. Hmm guess i'll change my record script to set the cl_autodemo variable to 1 when 1.6 is out because there is no need to record really every game..
Last edited by esteel on Thu Aug 31, 2006 7:44 pm, edited 1 time in total.
esteel
Site admin and forum addon
 
Posts: 3924
Joined: Wed Mar 01, 2006 8:27 am

Postby KadaverJack » Fri Apr 07, 2006 1:14 am

esteel wrote:Yeah thats true. Hmm guess i'll change my record script to set the cl_autodemo variable to 1 when 1.6 is out because there is no need to record really every game..

I would prefer an "Autorecord On/Off" switch in the menu instead of a shell script. A good place for it would be in the join menu, next to the refresh button imho.
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm

Re: small shell script for Linux users

Postby divVerent » Fri Apr 07, 2006 7:22 am

Crashzor wrote:For you how don't understand it put it in a file .sh
chmod 777 the file.


I don't want to be a nitpick, but: don't even get used to chmodding files 777.

If you own the file, all that matters is that you can do everything with it - that is, 700 suffices. Useful chmod values are:

  • 600 - you can read/write, nobody else can do anything
  • 640 - you can read/write, your group can read
  • 644 - you can read/write, everyone can read
  • 660 - you and your group can read/write, nobody else can do anything
  • 664 - you and your group can read/write, everyone can read
  • 666 - everyone can read and write


Additionally, shell scripts and programs need to be marked as executable so that the OS knows it is a script/program. This is basically done by replacing all fours by fives and all sixes by sevens. The access rights in the list would then be: 700, 750, 755, 770, 775, 777.

Usually, you don't want to give more access rights than 644 for regular files and 755 for directories and programs/scripts. These rights mean "everyone can read/execute/enter, nobody except you can write".

Of course, all this does not matter if you are the only one who uses the computer - but if you use "wrong" chmod values in a multi-user system like at university or on hoster where you can run a dedicated server, you can get severely screwed, that is, "owned" by others who access the same computer.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Next

Return to Nexuiz - Editing

Who is online

Users browsing this forum: No registered users and 1 guest