Lite Posted August 6, 2011 Share Posted August 6, 2011 Is it possible to use variables in the custom scripts? It doesn't work the way it works anywhere else, is there any other method to get it working? My script: touch /root/testfiles/notworking touch /root/testfiles/test$[service.GamePort] kill -9 $( lsof -i:$[service.GamePort] -t ) touch(es) are just for testing purposes, the file "notworking" is being created, the other one isn't. Regards, Florian Link to comment Share on other sites More sharing options...
LFA Posted August 6, 2011 Share Posted August 6, 2011 Yes but in batch shell scripts they are environment variables. Use {} instead of [] and _ instead of . http://help.tcadmin.com/Custom_Scripts touch /root/testfiles/test${Service_GamePort} kill -9 $( lsof -i:${Service_GamePort} -t ) Link to comment Share on other sites More sharing options...
Lite Posted August 6, 2011 Author Share Posted August 6, 2011 Thanks for the link. Variables are being used now, but i require the Service_GamePort variable in the "After stopped" event. Is there any way getting access to it? Link to comment Share on other sites More sharing options...
LFA Posted August 6, 2011 Share Posted August 6, 2011 Right now the port is not available but I can add it in the next update. What you can do for now is write it to a file on the after created event and read it in your after stopped event. Deny permissions to that file in the game's file system permissions so the user doesn't see it in file manager and ftp. Link to comment Share on other sites More sharing options...
LFA Posted August 6, 2011 Share Posted August 6, 2011 The script is executed in the game server's working directory. You don't need to use the full path when reading the file. Link to comment Share on other sites More sharing options...
Lite Posted August 6, 2011 Author Share Posted August 6, 2011 I've thought about that, but it would be just a temporary solution. It would be nice if you could include this in the next update. Link to comment Share on other sites More sharing options...
Lite Posted August 9, 2011 Author Share Posted August 9, 2011 Did you miss my request, or is it missing in the changelog? Link to comment Share on other sites More sharing options...
narutopgm Posted August 9, 2011 Share Posted August 9, 2011 ${Service_GamePort} don't work but ${ThisService_GamePort} work ! Link to comment Share on other sites More sharing options...
Lite Posted August 9, 2011 Author Share Posted August 9, 2011 ${ThisService_GamePort} doesn't contain the server port either. My testscript, executed in the "After stopped" event: touch /root/testfiles/notworking touch /root/testfiles/testpid${Service_Pid}_port${Service_GamePort}_port1${ThisService_GamePort} Link to comment Share on other sites More sharing options...
LFA Posted August 9, 2011 Share Posted August 9, 2011 2.0.30 was just to include some bug fixes and upgrade/downgrade of variables which was a quick change. These variables will be available in 2.0.31 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now