Donations
|
If you wish to make a donation you can by clicking the image below.
|
|
|
|
|
22nd February, 2006, 10:58 AM
|
Forum Newcomer
|
|
Join Date: Feb 2006
Posts: 10
|
|
need help for a simple startscipt
hi, i am from germany, sorry for my englisch knowledge.
I have a UT2004 under my Linux Red Hat root.
Normaly i start my UT2004 with the command line: ./ucc-bin server DM-Gael?game=XGame.xDeathMatch?Mutator=UT2Vote51.UT2V oteX -ini=ut2004.ini -nohomedir
Now i wanna write a start script to start/restart/terminate the server.
But i have no know how.
Can anybody write me a simple startscript?
many thanks for help.
Last edited by Skydix : 22nd February, 2006 at 11:37 AM.
|
22nd February, 2006, 06:09 PM
|
Holy Shit!!
|
|
Join Date: Sep 2004
Posts: 866
|
|
Well this is a simple start script which will restart on a crash and copy log file. To restart I normally use killall ucc-bin or the like, and to terminate killall <scriptname> I expect someone has a real start/stop/restart script tho
#!/bin/bash
cd /path/to/ut2004/System
while [ true ]
do
ucc-bin server DM-Gael?game=XGame.xDeathMatch?Mutator=UT2Vote51.UT2V oteX -ini=ut2004.ini -nohomedir
cp server.log crash.log
done
# EOF
__________________
http://www.unrealize.co.uk for XConsole, ServerLog, StealthAdmin and other Unreal Tournament mods.
-= F R A G G A L O N I A... R E S U R R E C T I O N! O L D... S K O O L... S N I P E R =- unreal://82.40.94.2
Old skool sniping. Just you, your weapon, and gravity.
Last edited by ~V~ : 22nd February, 2006 at 06:13 PM.
|
22nd February, 2006, 06:40 PM
|
Holy Shit!!
|
|
Join Date: Sep 2004
Posts: 866
|
|
Try making a second script and change the commented values for your system. For some reason killall isn't in path in slackware but it may on yours.
#!/bin/bash
server_start() {
/path/to/start/script & # put in full path and name of startup script
}
server_stop() {
/bin/killall startscript # your startup script name
/bin/killall ucc-bin # need to put in path to killall if its not in $PATH
}
server_restart() {
server_stop
sleep 1
server_start
}
case "$1" in
'start')
server_start
;;
'stop')
server_stop
;;
'restart')
server_restart
;;
*)
echo "usage $0 start|stop|restart"
esac
# EOF
__________________
http://www.unrealize.co.uk for XConsole, ServerLog, StealthAdmin and other Unreal Tournament mods.
-= F R A G G A L O N I A... R E S U R R E C T I O N! O L D... S K O O L... S N I P E R =- unreal://82.40.94.2
Old skool sniping. Just you, your weapon, and gravity.
Last edited by ~V~ : 22nd February, 2006 at 06:45 PM.
|
22nd February, 2006, 06:47 PM
|
Holy Shit!!
|
|
Join Date: Sep 2004
Posts: 866
|
|
Don't forget to chmod +x both scripts
__________________
http://www.unrealize.co.uk for XConsole, ServerLog, StealthAdmin and other Unreal Tournament mods.
-= F R A G G A L O N I A... R E S U R R E C T I O N! O L D... S K O O L... S N I P E R =- unreal://82.40.94.2
Old skool sniping. Just you, your weapon, and gravity.
|
22nd February, 2006, 09:32 PM
|
Forum Newcomer
|
|
Join Date: Feb 2006
Posts: 10
|
|
Thanks for help
anything is wrong.
I received the message:
./startscript.sh
: bad interpreter: No such file or directory
whats my fault ?
i edited the small script with my settings...: name: startscript.sh
---------------------------------
#!/bin/bash
cd /home/ut2004.server/UT2004/System/
while [ true ]
do
ucc-bin server DM-Gael?game=XGame.xDeathMatch?Mutator=UT2Vote51.UT2V oteX -ini=ut2004.ini -nohomedir
cp server.log crash.log
done
# EOF
------------------------------
and the big script: name: startscript2.sh
------------------------------
#!/bin/bash
server_start() {
/home/ut2004.server/UT2004/System/ucc-bin server DM-Gael?game=XGame.xDeathMatch?Mutator=UT2Vote51.UT2V oteX -ini=ut2004.ini -nohomedir
}
server_stop() {
/bin/killall startscript2
/bin/killall ucc-bin # need to put in path to killall if its not in $PATH
}
server_restart() {
server_stop
sleep 1
server_start
}
case "$1" in
'start')
server_start
;;
'stop')
server_stop
;;
'restart')
server_restart
;;
*)
echo "usage $0 start|stop|restart"
esac
# EOF
______
is it right that i execute the script with: ./startscript.sh ? yes, or ?
PS: chmod is executed
Last edited by Skydix : 22nd February, 2006 at 09:36 PM.
|
22nd February, 2006, 09:45 PM
|
Holy Shit!!
|
|
Join Date: Sep 2004
Posts: 866
|
|
server_start() {
/home/ut2004.server/UT2004/System/ucc-bin server DM-Gael?game=XGame.xDeathMatch?Mutator=UT2Vote51.UT2V oteX -ini=ut2004.ini -nohomedir
}
in the big script is wrong - it should just point to the (small) startup script startscript.sh ie
server_start() {
/home/ut2004.server/UT2004/System/startscript.sh &
}
and the stop part should also be like it:
server_stop() {
/bin/killall startscript.sh
/bin/killall ucc-bin # need to put in path to killall if its not in $PATH
}
then name it (the big script) something thats a better description maybe like utserver
make sure both files are chmod +x
either copy the utserver script to somewhere in your path or just in your home dir
if its in your path you just type utserver start
or if in home and you are in home then ./utserver start
of course then you can also use utserver stop and restart as well
__________________
http://www.unrealize.co.uk for XConsole, ServerLog, StealthAdmin and other Unreal Tournament mods.
-= F R A G G A L O N I A... R E S U R R E C T I O N! O L D... S K O O L... S N I P E R =- unreal://82.40.94.2
Old skool sniping. Just you, your weapon, and gravity.
Last edited by ~V~ : 22nd February, 2006 at 09:48 PM.
|
22nd February, 2006, 09:47 PM
|
Holy Shit!!
|
|
Join Date: Sep 2004
Posts: 866
|
|
also check that the killall command is in bin first. If it's in your path (ie just typing killall works) then delete the /bin/ part
if it's not in your path, you need to do 'locate killall' and change the script to where it is
__________________
http://www.unrealize.co.uk for XConsole, ServerLog, StealthAdmin and other Unreal Tournament mods.
-= F R A G G A L O N I A... R E S U R R E C T I O N! O L D... S K O O L... S N I P E R =- unreal://82.40.94.2
Old skool sniping. Just you, your weapon, and gravity.
|
22nd February, 2006, 09:52 PM
|
Holy Shit!!
|
|
Join Date: Sep 2004
Posts: 866
|
|
also if you want to have output from the server in a terminal, you can change the startscript.sh to read
#!/bin/bash
cd /home/ut2004.server/UT2004/System/
while [ true ]
do
aterm -e ucc-bin server DM-Gael?game=XGame.xDeathMatch?Mutator=UT2Vote51.UT2V oteX -ini=ut2004.ini -nohomedir
cp server.log crash.log
done
# EOF
change aterm to whichever terminal you use (aterm, xterm, konsole, rxvt, eterm etc)
__________________
http://www.unrealize.co.uk for XConsole, ServerLog, StealthAdmin and other Unreal Tournament mods.
-= F R A G G A L O N I A... R E S U R R E C T I O N! O L D... S K O O L... S N I P E R =- unreal://82.40.94.2
Old skool sniping. Just you, your weapon, and gravity.
Last edited by ~V~ : 22nd February, 2006 at 09:55 PM.
|
23rd February, 2006, 12:55 PM
|
Forum Newcomer
|
|
Join Date: Feb 2006
Posts: 10
|
|
anything as yet is wrong.
I edited the two script how do you wrote it.
But if i write the i get the notification: : bad interpreter: No such file or directory
Whats my fault? damned know how
Here my smal Script: startscript.sh Thats in /home/ut2004.server/UT2004/System/
-------------------
#!/bin/bash
cd /home/ut2004.server/UT2004/System/
while [ true ]
do
aterm -e ucc-bin server DM-Gael?game=XGame.xDeathMatch?Mutator=UT2Vote51.UT2V oteX -ini=ut2004.ini -nohomedir
cp server.log crash.log
done
# EOF
-------------------
and my big script: utserver.sh That's in /home/ut2004.server/
-------------------
#!/bin/bash
server_start() {
/home/ut2004.server/UT2004/System/startscript.sh &
}
server_stop() {
/usr/bin/killall startscript
/usr/bin/killall ucc-bin
}
server_restart() {
server_stop
sleep 1
server_start
}
case "$1" in
'start')
server_start
;;
'stop')
server_stop
;;
'restart')
server_restart
;;
*)
echo "usage $0 start|stop|restart"
esac
# EOF
-----------------------------
If you have time endurance please help me.
Big thanks.
Last edited by Skydix : 23rd February, 2006 at 01:01 PM.
|
23rd February, 2006, 03:03 PM
|
Holy Shit!!
|
|
Join Date: Sep 2004
Posts: 866
|
|
First of all, do you have aterm installed? If not you will need to change to whatever terminal you have in the small script aterm -e ucc-bin ...
Also you don't need to put .sh on end of files but if you do then change the line
/usr/bin/killall startscript to /usr/bin/killall startscript.sh
Also check the location of 'killall'
__________________
http://www.unrealize.co.uk for XConsole, ServerLog, StealthAdmin and other Unreal Tournament mods.
-= F R A G G A L O N I A... R E S U R R E C T I O N! O L D... S K O O L... S N I P E R =- unreal://82.40.94.2
Old skool sniping. Just you, your weapon, and gravity.
Last edited by ~V~ : 23rd February, 2006 at 03:08 PM.
|
23rd February, 2006, 05:24 PM
|
Forum Newcomer
|
|
Join Date: Feb 2006
Posts: 10
|
|
my location of killall is /usr/bin/killal
i dont know witch terminal i use.
therefore i deleted the line "aterm -e"
but if i start the big script "utserver" i recieved the message : bad interpreter: No such file or directory
#!/bin/bash
cd /home/ut2004.server/UT2004/System/
while [ true ]
do
ucc-bin server DM-Gael?game=XGame.xDeathMatch?Mutator=UT2Vote51.UT2V oteX -ini=ut2004.ini -nohomedir
cp server.log crash.log
done
# EOF
|
23rd February, 2006, 07:01 PM
|
Holy Shit!!
|
|
Join Date: Sep 2004
Posts: 866
|
|
Did you put utserver in your path? If no then you must run it with ./utserver start/stop/restart
Of course you must cd to the dir containing it
__________________
http://www.unrealize.co.uk for XConsole, ServerLog, StealthAdmin and other Unreal Tournament mods.
-= F R A G G A L O N I A... R E S U R R E C T I O N! O L D... S K O O L... S N I P E R =- unreal://82.40.94.2
Old skool sniping. Just you, your weapon, and gravity.
|
23rd February, 2006, 07:04 PM
|
Holy Shit!!
|
|
Join Date: Sep 2004
Posts: 866
|
|
To know your terminal - it normally says at top of window. If you are running kde it will be konsole. For gnome it's gnome-terminal.
Normally evry distro comes with xterm tho so try 'xterm -e'
__________________
http://www.unrealize.co.uk for XConsole, ServerLog, StealthAdmin and other Unreal Tournament mods.
-= F R A G G A L O N I A... R E S U R R E C T I O N! O L D... S K O O L... S N I P E R =- unreal://82.40.94.2
Old skool sniping. Just you, your weapon, and gravity.
|
23rd February, 2006, 09:35 PM
|
Forum Newcomer
|
|
Join Date: Feb 2006
Posts: 10
|
|
hmm i dont know. I can do what i want... the stupid say me ever the same...: : bad interpreter: No such file or directory
utserver is in my home directory "ut2004.server" and in /home/ut2004.server/UT2004/System/
if i execute the file in this two directorys i have the same result/message.
I dont know what's wrong
and i have a root. this computer dont hav kde or gnome. i work only with the shell.
and it's curious.. my red hat dont know "xterm -e" or normally xterm
|
23rd February, 2006, 09:57 PM
|
Holy Shit!!
|
|
Join Date: Sep 2004
Posts: 866
|
|
what happens if you run utserver script without start, stop or restart?
Does is print a message on usage? IE:
"usage utserver start|stop|restart"
?
__________________
http://www.unrealize.co.uk for XConsole, ServerLog, StealthAdmin and other Unreal Tournament mods.
-= F R A G G A L O N I A... R E S U R R E C T I O N! O L D... S K O O L... S N I P E R =- unreal://82.40.94.2
Old skool sniping. Just you, your weapon, and gravity.
|
23rd February, 2006, 11:29 PM
|
Forum Newcomer
|
|
Join Date: Feb 2006
Posts: 10
|
|
he don't print a message like "usage utserver start|stop|restart"
i start the script how dou you wrote it.
for example: ./utserver start
and than i become the message ": bad interpreter: No such file or directory"
confuse
|
23rd February, 2006, 11:45 PM
|
Holy Shit!!
|
|
Join Date: Sep 2004
Posts: 866
|
|
No. I'm saying start it with just 'utserver' not with start and then tell me what happens. To test.
__________________
http://www.unrealize.co.uk for XConsole, ServerLog, StealthAdmin and other Unreal Tournament mods.
-= F R A G G A L O N I A... R E S U R R E C T I O N! O L D... S K O O L... S N I P E R =- unreal://82.40.94.2
Old skool sniping. Just you, your weapon, and gravity.
|
23rd February, 2006, 11:58 PM
|
Forum Newcomer
|
|
Join Date: Feb 2006
Posts: 10
|
|
ops hmm ok
.. same result. ": bad interpreter: No such file or directory"
|
24th February, 2006, 12:12 AM
|
Holy Shit!!
|
|
Join Date: Sep 2004
Posts: 866
|
|
Then you aren't starting the script at all.
If you named it utserver.sh you need to be in same directory and start it with ./utserver.sh, or, put it in your path (echo $PATH to find it) like /usr/bin/ and start it with just the name utserver.sh
Are you on msn? I'm sure this is easily fixed.
__________________
http://www.unrealize.co.uk for XConsole, ServerLog, StealthAdmin and other Unreal Tournament mods.
-= F R A G G A L O N I A... R E S U R R E C T I O N! O L D... S K O O L... S N I P E R =- unreal://82.40.94.2
Old skool sniping. Just you, your weapon, and gravity.
|
24th February, 2006, 11:29 AM
|
Forum Newcomer
|
|
Join Date: Feb 2006
Posts: 10
|
|
i'm being at a loss.
so, i don't have MSN but ICQ: 51770686 an i am in IRC on #kaoskommune
is there any chance that we could meet each other?
Last edited by Skydix : 24th February, 2006 at 11:34 AM.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|