init III
This commit is contained in:
16
PHP Freeproxy/index.php
Normal file
16
PHP Freeproxy/index.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
# call:
|
||||
# http://x.y.z?open=1 öffnet proxy port für externe ip
|
||||
# http://x.y.z?close=1 schließt proxy port komplett
|
||||
|
||||
echo "Ihre IP: " . $_SERVER['REMOTE_ADDR'];
|
||||
if ($_GET["open"] == "1") {
|
||||
file_put_contents("/var/www/freeproxy/ip", $_SERVER['REMOTE_ADDR'] . "\n");
|
||||
`cat /var/www/freeproxy/ip >> /var/www/freeproxy/ips`;
|
||||
`rm /var/www/freeproxy/ip`;
|
||||
}
|
||||
if ($_GET["close"] == "1") {
|
||||
`rm /var/www/freeproxy/ips`;
|
||||
}
|
||||
`touch /var/www/freeproxy/new`;
|
||||
|
||||
10
PHP Freeproxy/openproxy.sh
Normal file
10
PHP Freeproxy/openproxy.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
if [ -f /var/www/freeproxy/new ]; then
|
||||
/sbin/iptables -F PROXY.chain
|
||||
for I in `cat /var/www/freeproxy/ips`;
|
||||
do
|
||||
/sbin/iptables -A PROXY.chain -p tcp -s $I --dport 8080 -j ACCEPT
|
||||
done
|
||||
rm /var/www/freeproxy/new
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user