Last active
August 29, 2015 14:25
-
-
Save Nixtren/406c50f93bcac79ec61f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Quickly coded by Nixtren | |
echo "Welcome to the (unofficial) LowEndSpirit TeamSpeak setup script!\n"; | |
$port_base = exec(<<<HEREDOC | |
ifconfig | grep venet0:0 -A 1 | grep inet | awk '{print $2}' | sed -e 's/addr://g' | awk -F "[. \t]*" '/^[0-9]+./ {print $4,$5}' | |
HEREDOC | |
); // This exec command was taken from the official LES TS bash setup script, credits to Anthony. | |
$voice_port = "{$port_base}09"; // The voice port the TeamSpeak server will use, following the logic of the original bash script | |
$filetransfer_port = "{$port_base}10"; // The file transfer port the TeamSpeak server will use, following the logic of the original bash script | |
$ts3server_startscript = file_get_contents("ts3server_startscript.sh"); | |
$ts3server_startscript = str_replace("COMMANDLINE_PARAMETERS=\"\${2}\"", "COMMANDLINE_PARAMETERS=\"\${4} default_voice_port={$voice_port} filetransfer_port={$filetransfer_port} filetransfer_ip=0.0.0.0\"", $ts3server_startscript); // http://forum.lowendspirit.com/viewtopic.php?pid=9793#p9793 | |
unlink("ts3server_startscript.sh"); | |
file_put_contents("ts3server_startscript.sh", $ts3server_startscript); | |
exec("chmod +x ./ts3server_startscript.sh"); | |
echo "Done, your voice port is {$voice_port}\nTo start your TeamSpeak server run ./ts3server_startscript.sh start\n"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment