SHOW:
|
|
- or go back to the newest paste.
1 | <? ob_start(); ?> | |
2 | <?php | |
3 | $fastdl = "http://domain.org/fastdl/csgo"; // Your fastdl root folder, make sure there is no / on the end. | |
4 | $ftp_server = "93.186.198.32"; // The FTP IP for your server, no port // 93.186... ist meine Gameserver IP | |
5 | ||
6 | if($_GET['dl']) { | |
7 | $dlfile=$_GET['dl']; | |
8 | ||
9 | if(!file_exists(substr($dlfile, 1)) && substr($dlfile, -8) == ".dua.bz2") { | |
10 | $dldua=substr($dlfile, 1, -4); | |
11 | ||
12 | if (file_exists("0")) { | |
13 | rename("0", "1"); | |
14 | } elseif(file_exists("1")) { | |
15 | sleep(5); | |
16 | header("Location: " . $fastdl . $dlfile); | |
17 | exit; | |
18 | } | |
19 | ||
20 | $conn_id = ftp_connect($ftp_server, "21"); // Default port for FTP, change if needed | |
21 | $login_result = ftp_login($conn_id, "****", "****"); // Your server FTP user/pass here. | |
22 | ||
23 | ftp_pasv($conn_id, true); | |
24 | ftp_chdir($conn_id, "93.186.198.32 port 28015/counterstrike_go/csgo"); // If your home folder when you connect to your server's FTP isnt the base garrysmod folder, navigate to it here. If it is, comment/delete this line. | |
25 | ftp_get($conn_id, $dldua, $dldua, FTP_BINARY); | |
26 | ftp_close($conn_id); | |
27 | ||
28 | $data = file_get_contents($dldua); | |
29 | file_put_contents("compress.bzip2://" . substr($dlfile, 1), $data); | |
30 | //unlink($dldua); Deletes the .dua after it has been added to the archive, I wouldn't recommend this as sometimes players seem to ask for the .dua rather than the .dua.bz2. | |
31 | ||
32 | rename("1", "0"); | |
33 | header("Location: " . $fastdl . $dlfile); | |
34 | ||
35 | exit; | |
36 | } | |
37 | else { | |
38 | header("Location: " . $fastdl . $dlfile); | |
39 | } | |
40 | } else { | |
41 | // This can be modified as you please and will be displayed when someone tries to access this file from their web browser with no parameters specified. | |
42 | /*echo "<html> | |
43 | <head> | |
44 | <title></title> | |
45 | </head> | |
46 | <body> | |
47 | </body> | |
48 | </html>";*/ | |
49 | header("Location: " . "http://quantumroyal.org"); | |
50 | } | |
51 | ?> | |
52 | - | <? ob_end_flush(); ?> |
52 | + | <? ob_end_flush(); ?> |
53 | ||
54 | ||
55 | ||
56 | Quelle: https://facepunch.com/showthread.php?t=1205157 |