View Single Post
Author Message
ghostofmybrain
Veteran Member
Join Date: Mar 2010
Old 04-15-2012 , 14:24   HLTV crontab script
Reply With Quote #1

I am attempting to start an HLTV server with a script so I can execute it through crontab should I happen to reboot the machine.

Normally, if I try to start HLTV, I have to launch screen, and then execute the command

Code:
export LD_LIBRARY_PATH=".:LD_LIBRARY_PATH"
before using the hltv start command. (If I don't, it errors out, which is a common known issue with hltv on linux.)

I am trying to do that in a bash script.

If my script reads like this, it launches a screen instance, but of course fails to launch the HLTV server because of the known errors without exporting that library.
Code:
#!/bin/bash

screen -X -S aim quit
sleep 4
cd /home/gamer/hltv/cstrike/aim
/usr/bin/screen -dmS aim ./hltv +exec hltv_aim.cfg -port 27021
The minute I add the export, it no longer launches the screen.

Code:
#!/bin/bash

screen -X -S aim quit
sleep 4
cd /home/gamer/hltv/cstrike/aim
/usr/bin/screen -dmS aim export LD_LIBRARY_PATH=".:LD_LIBRARY_PATH" && ./hltv +exec hltv_aim.cfg -port 27021
Instead, it ignores the screen command, ignores the export command, and instead attempts to launch the hltv in the current window. (Which of course fails.)

Any ideas how to use a script to launch an HLTV?
__________________
Boycott ESEA
My servers
ghostofmybrain is offline