-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
58 lines (48 loc) · 1.54 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/*
For Multiple PT Bot in one machine:
If you host multiple PT Bot in same machine,
define domain name and corresponding username
and pt listen port number below in $domains
you may define $domains array in domains.php in
same directory as config.php
For Single PT bot:
If you only use single PT Bot, comment out or
remove $domains array.
Default is user "pt0" with port "8080"
*/
$domains = [
// Domain for username, pt port
"localhost" => [ "pt0", 8080],
"127.0.0.1" => [ "pt0", 8080],
"pt0.ass.tw" => [ "pt0", 8080],
"pt1.ass.tw" => [ "pt1", 8081],
"pt2.ass.tw" => [ "pt2", 8082],
];
if(file_exists("domains.php"))
include "domains.php";
$user="pt0";
$port="8080";
$host=$_SERVER['HTTP_HOST'];
if(isset($domains) && array_key_exists($host, $domains)){
$user=$domains[$host][0];
$port=$domains[$host][1];
}
// default interface language (en,zhTW)
$lang="zhTW";
// profit trailer url
$url="http://127.0.0.1:$port";
// profit trailer bot install path
$path_pt="/bot/$user";
// profit trailer bot log path by php exec()
$path_pt_log="/bot/$user/pt.log";
// cmd to start and stop bot by php exec()
// in order for user www-data/apache..etc to do sudo
// please use visudo to give php user permission to sudo
// the script, or you may use differnt ways to start/stop
// PT bot, try use your imagination :)
$script_bot_on = "sudo /bot/ptbot.sh start $user";
$script_bot_off = "sudo /bot/ptbot.sh stop $user";
// cmd to clear log by php exec()
$script_bot_log_clear = "sudo /bot/ptbot.sh clear $user";
?>