lic draft
This commit is contained in:
1 parent
92bd9c3250
commit
25554dd318
5 files changed
+578
-30
No files matched your search
+7
-1
@@ -3,14 +3,17 @@ mod relay_server;
|
||||
use hbb_common::{env_logger::*, ResultType};
|
||||
use relay_server::*;
|
||||
use std::sync::{Arc, Mutex};
|
||||
mod lic;
|
||||
|
||||
fn main() -> ResultType<()> {
|
||||
init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info"));
|
||||
let args = format!(
|
||||
"-p, --port=[NUMBER(default={})] 'Sets the listening port'
|
||||
-k, --key=[KEY] 'Only allow the client with the same key'
|
||||
{}
|
||||
",
|
||||
DEFAULT_PORT
|
||||
DEFAULT_PORT,
|
||||
lic::EMAIL_ARG
|
||||
);
|
||||
let matches = App::new("hbbr")
|
||||
.version(hbbs::VERSION)
|
||||
@@ -18,6 +21,9 @@ fn main() -> ResultType<()> {
|
||||
.about("RustDesk Relay Server")
|
||||
.args_from_usage(&args)
|
||||
.get_matches();
|
||||
if !lic::check_lic(matches.value_of("email").unwrap_or("")) {
|
||||
return Ok(());
|
||||
}
|
||||
let stop: Arc<Mutex<bool>> = Default::default();
|
||||
start(
|
||||
matches.value_of("port").unwrap_or(DEFAULT_PORT),
|
||||
|
||||
Reference in new issue
Block a user