Need a way to start rotation script when the new match begin
- Al's Used Cars
- On Lightcycle Grid
- Posts: 45
- Joined: Sun Dec 03, 2006 3:22 pm
- Location: Baltimore, MD
this is what happens when i enter the cmd:
admin@ubuntu:~$ sudo tail -f -n0 /home/admin/soc/var/ladderlog.txt | /home/admin/soc/etc/games/armagetronad-dedicated/rotation3.sh
-bash: /home/admin/soc/etc/games/armagetronad-dedicated/rotation3.sh: Permission denied
Password:
i enter the pswd, then theres nothing... should there be a confirmation, or some sign that its now working?
should i try to incorporate a login into the command?
admin@ubuntu:~$ sudo tail -f -n0 /home/admin/soc/var/ladderlog.txt | /home/admin/soc/etc/games/armagetronad-dedicated/rotation3.sh
-bash: /home/admin/soc/etc/games/armagetronad-dedicated/rotation3.sh: Permission denied
Password:
i enter the pswd, then theres nothing... should there be a confirmation, or some sign that its now working?
should i try to incorporate a login into the command?
- Al's Used Cars
- On Lightcycle Grid
- Posts: 45
- Joined: Sun Dec 03, 2006 3:22 pm
- Location: Baltimore, MD
heres what i used to make exec
admin@ubuntu:~/soc/data$ cd /home/admin/soc/etc/games/armagetronad-dedicated/
admin@ubuntu:~/soc/etc/games/armagetronad-dedicated$ sudo chmod a=r+w+x rotation3.sh
Password:
admin@ubuntu:~/soc/etc/games/armagetronad-dedicated$
((server msg on login says:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.))
admin@ubuntu:~/soc/data$ cd /home/admin/soc/etc/games/armagetronad-dedicated/
admin@ubuntu:~/soc/etc/games/armagetronad-dedicated$ sudo chmod a=r+w+x rotation3.sh
Password:
admin@ubuntu:~/soc/etc/games/armagetronad-dedicated$
((server msg on login says:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.))
- Al's Used Cars
- On Lightcycle Grid
- Posts: 45
- Joined: Sun Dec 03, 2006 3:22 pm
- Location: Baltimore, MD
ok, now i'm getting a reaction/ feedback
PLAYER_ENTERED |fa|_almighty 7#.##.##.##
[: 27: ==: unexpected operator
[: 27: ==: unexpected operator
NEW_ROUND
[: 27: ==: unexpected operator
[: 27: ==: unexpected operator
NEW_MATCH
[: 27: ==: unexpected operator
[: 27: ==: unexpected operator
DEATH_SUICIDE |fa|_almighty
PLAYER_ENTERED |fa|_almighty 7#.##.##.##
[: 27: ==: unexpected operator
[: 27: ==: unexpected operator
NEW_ROUND
[: 27: ==: unexpected operator
[: 27: ==: unexpected operator
NEW_MATCH
[: 27: ==: unexpected operator
[: 27: ==: unexpected operator
DEATH_SUICIDE |fa|_almighty
- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
a=r+w+x should work although it's clumsy (a=rwx or just rwx would work, in particular if your intention is to give everyone who might be around write access, but what you probably want is simply +x). What does "ls -l rotation3.sh" say the mode is?Al's Used Cars wrote:admin@ubuntu:~/soc/etc/games/armagetronad-dedicated$ sudo chmod a=r+w+x rotation3.sh
Yeah, but you probably don't need root to access your own stuff.Al's Used Cars wrote:((server msg on login says:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.))
ˌɑrməˈɡɛˌtrɑn
- Al's Used Cars
- On Lightcycle Grid
- Posts: 45
- Joined: Sun Dec 03, 2006 3:22 pm
- Location: Baltimore, MD
- Al's Used Cars
- On Lightcycle Grid
- Posts: 45
- Joined: Sun Dec 03, 2006 3:22 pm
- Location: Baltimore, MD
- Al's Used Cars
- On Lightcycle Grid
- Posts: 45
- Joined: Sun Dec 03, 2006 3:22 pm
- Location: Baltimore, MD
- Al's Used Cars
- On Lightcycle Grid
- Posts: 45
- Joined: Sun Dec 03, 2006 3:22 pm
- Location: Baltimore, MD
Project Summary:
for anyone trying to do something similiar, heres the finshed script:
note that zero values must be written in order to not skip round 2.
and the tail comd is this:
tail -f -n0 /entirepath/ladderlog.txt | /entirepath/scriptname.sh
-----------------------------------------------
#!/bin/sh
# create used variables
round=""
num_rounds="10" #the total number of rounds per match
#begin loop
while true;
do
read line
echo $line
if [ "$line" = "NEW_ROUND" ]
then
round=$(($round + 1));
if [ $round = $num_rounds ]
then
round="0";
fi
#resets to arena 1 with new match
if [ "$line" = "NEW_MATCH" ]
then
round="0";
fi
if [ "$line" = "GAME_END" ]
then
round="0";
fi
#outputs rotation line into cfg
echo "INCLUDE round${round}.cfg" > /home/admin/soc/etc/games/armagetronad-dedicated/everytime.cfg;
fi
done
-------------------------------------
NB:
after saving in server dir somewhere, you must
make it executable- and if you change it, you must make it executable again
with (cd to dir of script above) chmod +x scriptname.sh
then run tail cmd above to begin. you should see a line output in the terminal window when the server is being played.
good luck,
AL
for anyone trying to do something similiar, heres the finshed script:
note that zero values must be written in order to not skip round 2.
and the tail comd is this:
tail -f -n0 /entirepath/ladderlog.txt | /entirepath/scriptname.sh
-----------------------------------------------
#!/bin/sh
# create used variables
round=""
num_rounds="10" #the total number of rounds per match
#begin loop
while true;
do
read line
echo $line
if [ "$line" = "NEW_ROUND" ]
then
round=$(($round + 1));
if [ $round = $num_rounds ]
then
round="0";
fi
#resets to arena 1 with new match
if [ "$line" = "NEW_MATCH" ]
then
round="0";
fi
if [ "$line" = "GAME_END" ]
then
round="0";
fi
#outputs rotation line into cfg
echo "INCLUDE round${round}.cfg" > /home/admin/soc/etc/games/armagetronad-dedicated/everytime.cfg;
fi
done
-------------------------------------
NB:
after saving in server dir somewhere, you must
make it executable- and if you change it, you must make it executable again
with (cd to dir of script above) chmod +x scriptname.sh
then run tail cmd above to begin. you should see a line output in the terminal window when the server is being played.
good luck,
AL
- Al's Used Cars
- On Lightcycle Grid
- Posts: 45
- Joined: Sun Dec 03, 2006 3:22 pm
- Location: Baltimore, MD
right....
could someone answer the question re screen?
i've had power outages in my location and the cmd stops running when my comp goes down, so the server stops rotation. I've read man_screen, just dont understand how it is implemented with a cmd like "tail -n0 path/file | path/file"
an xample, pls? where does -d go?
could someone answer the question re screen?
i've had power outages in my location and the cmd stops running when my comp goes down, so the server stops rotation. I've read man_screen, just dont understand how it is implemented with a cmd like "tail -n0 path/file | path/file"
an xample, pls? where does -d go?
- Al's Used Cars
- On Lightcycle Grid
- Posts: 45
- Joined: Sun Dec 03, 2006 3:22 pm
- Location: Baltimore, MD
- Al's Used Cars
- On Lightcycle Grid
- Posts: 45
- Joined: Sun Dec 03, 2006 3:22 pm
- Location: Baltimore, MD