|
<?php
|
|
|
|
$rootPW = $_POST["rootPW"];
|
|
$nodename = $_POST["nodename"];
|
|
$newTorState = "node"
|
|
|
|
$configureHiddenService1 = "echo $rootPW | sudo -S sed -i 's/#HiddenServiceDir\ \/var\/lib\/tor\/hidden_service/HiddenServiceDir\ \/var\/lib\/tor\/$hsname/' /etc/tor/torrc";
|
|
$configureHiddenService2 = "echo $rootPW | sudo -S sed '0,/#HiddenServiceP/{s/#HiddenServicePort\ 80 127.0.0.1:80/HiddenServicePort 80 127.0.0.1:80\nHiddenServicePort 22 127.0.0.1:22/}' /etc/tor/torrc";
|
|
$configureMiddleRelay1 = "echo $rootPW | sudo -S sed '0,/#ORPort\ 443\ NoListen/{s/#ORPort\ 443\ NoListen/ORPort\ 443\nNickname\ $nodename\nExitRelay\ 0\nSocksPort\ 0/}' /etc/tor/torrc";
|
|
$configureFromNode2BridgeRelay1 = "echo $rootPW | sudo -S sed '0,/ORPort\ 443\nNickname/{s/ORPort\ 443\nNickname\ $nodename\nExitRelay\ 0\nSocksPort\ 0/ORPort\ 443/}' /etc/tor/torrc";
|
|
$configureFromNode2BridgeRelay2 = "echo $rootPW | sudo -S sed '0,/#BridgeRelay\ 1/{s/#BridgeRelay\ 1/BridgeRelay\ 1/}' /etc/tor/torrc";
|
|
$configureFromBridge2MiddleRelay1 = "echo $rootPW | sudo -S sed '0,/ORPort\ 443/{s/ORPort\ 443/ORPort\ 443\nNickname\ $nodename\nExitRelay\ 0\nSocksPort\ 0/}' /etc/tor/torrc";
|
|
$configureFromBridge2MiddleRelay2 = "echo $rootPW | sudo -S sed '0,/BridgeRelay\ 1/{s/BridgeRelay\ 1/#BridgeRelay\ 1/}' /etc/tor/torrc";
|
|
|
|
$restartTor = "echo $rootPW | sudo -S systemctl restart tor";
|
|
$replaceTorState = "echo $newTorState > torstate.csv"
|
|
|
|
$output = exec($configureFromBridge2MiddleRelay1);
|
|
$output2 = exec($configureFromBridge2MiddleRelay2);
|
|
$output3 = exec($restartTor);
|
|
$output4 = exec($replaceTorState);
|
|
|
|
echo $output3;
|
|
|
|
echo " oi oi oi ";
|
|
|
|
?>
|
|
|