mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-25 01:10:19 -05:00
Merge pull request #2643 from csoler/v0.6-TorControl3
V0.6 tor control3
This commit is contained in:
commit
f22671dda9
@ -47,17 +47,22 @@ int main(int argc, char* argv[])
|
|||||||
//RsControl::earlyInitNotificationSystem();
|
//RsControl::earlyInitNotificationSystem();
|
||||||
|
|
||||||
std::string base_directory = "FSData";
|
std::string base_directory = "FSData";
|
||||||
|
std::string tor_executable_path ;
|
||||||
|
|
||||||
argstream as(argc,argv);
|
argstream as(argc,argv);
|
||||||
|
|
||||||
as >> parameter( 'c',"base-dir", base_directory, "set base directory to store data files (keys, etc)", false )
|
as >> parameter( 'c',"base-dir", base_directory, "set base directory to store data files (keys, etc)", false )
|
||||||
>> help( 'h', "help", "Display this Help" );
|
>> parameter( 't',"tor-executable", tor_executable_path, "set absolute path for tor executable", false )
|
||||||
|
>> help( 'h', "help", "Display this Help" );
|
||||||
|
|
||||||
as.defaultErrorHandling(true, true);
|
as.defaultErrorHandling(true, true);
|
||||||
|
|
||||||
RsConfigOptions conf;
|
RsConfigOptions conf;
|
||||||
conf.main_executable_path = argv[0];
|
conf.main_executable_path = argv[0];
|
||||||
|
|
||||||
|
if(!tor_executable_path.empty())
|
||||||
|
RsTor::setTorExecutablePath(tor_executable_path);
|
||||||
|
|
||||||
RsInit::InitRsConfig();
|
RsInit::InitRsConfig();
|
||||||
RsInit::InitRetroShare(conf);
|
RsInit::InitRetroShare(conf);
|
||||||
|
|
||||||
@ -68,6 +73,19 @@ int main(int argc, char* argv[])
|
|||||||
RsErr() << "Cannot create base directory \"" << base_directory << "\". Check permissions, paths, etc." ;
|
RsErr() << "Cannot create base directory \"" << base_directory << "\". Check permissions, paths, etc." ;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check the existance of the Tor executable path
|
||||||
|
|
||||||
|
auto tor_path = RsTor::torExecutablePath();
|
||||||
|
|
||||||
|
if (!RsDirUtil::fileExists(tor_path))
|
||||||
|
{
|
||||||
|
RsErr() << "Tor executable \"" << tor_path << "\" not found. Try supplying the correct full path for a tor executable with the -t option.";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
RsDbg() << "Using Tor executable: \"" << tor_path << "\"";
|
||||||
|
|
||||||
// Create/start TorManager
|
// Create/start TorManager
|
||||||
|
|
||||||
RsTor::setTorDataDirectory(RsDirUtil::makePath(base_directory,"tor"));
|
RsTor::setTorDataDirectory(RsDirUtil::makePath(base_directory,"tor"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user